hi
i want to have a "close" button that user can click but that will also
"click itself after 10 sec"
so heres what i did
function auto_close(x)
{
if(x>0){ document.form.b utton.value="CL OSE (auto close in "+ x +" sec)";
x--;
setTimeout("aut o_close(x);",10 00);
} else self.close();
}
and i put onload=auto_clo se(10)
the problem is that the first time the recursion is called (
setTimeout("aut o_close(x);",10 00);) IE says x is undifined
i dont understand!!
please help, Gordan
i want to have a "close" button that user can click but that will also
"click itself after 10 sec"
so heres what i did
function auto_close(x)
{
if(x>0){ document.form.b utton.value="CL OSE (auto close in "+ x +" sec)";
x--;
setTimeout("aut o_close(x);",10 00);
} else self.close();
}
and i put onload=auto_clo se(10)
the problem is that the first time the recursion is called (
setTimeout("aut o_close(x);",10 00);) IE says x is undifined
i dont understand!!
please help, Gordan
Comment