richiej
Oct 5th 2007, 6:06 am
Hi,
I am testing out an idea for an application I am writing. I am trying to get a] DOM object to be a 'flag' to say that something has happened (textbox had its texted changed for instance) and then when a user clicks on a button an alert will appear if something has been changed. I am only proving an idea at this stage, in my full application the mechanism will a whole lot wider.
However, I get a syntax error on my page and by commenting out lines I have determined that it is my first line that is causing the problem. Here is my code:
<script>
var oChange = null;
/*
function Call()
{
<%=sReturn%>
}
*/
function TestInterface()
{
if (oChange <> null)
{
window.alert("This is working");
}
}
function TestChanges()
{
oChange = 'TRUE';
}
</script>
The line with the colour change is the problem, I always thought u could declare DOM objects outside a function. Is this not the case?
thanks in advance
I am testing out an idea for an application I am writing. I am trying to get a] DOM object to be a 'flag' to say that something has happened (textbox had its texted changed for instance) and then when a user clicks on a button an alert will appear if something has been changed. I am only proving an idea at this stage, in my full application the mechanism will a whole lot wider.
However, I get a syntax error on my page and by commenting out lines I have determined that it is my first line that is causing the problem. Here is my code:
<script>
var oChange = null;
/*
function Call()
{
<%=sReturn%>
}
*/
function TestInterface()
{
if (oChange <> null)
{
window.alert("This is working");
}
}
function TestChanges()
{
oChange = 'TRUE';
}
</script>
The line with the colour change is the problem, I always thought u could declare DOM objects outside a function. Is this not the case?
thanks in advance