G
Gordan
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.button.value="CLOSE (auto close in "+ x +" sec)";
x--;
setTimeout("auto_close(x);",1000);
} else self.close();
}
and i put onload=auto_close(10)
the problem is that the first time the recursion is called (
setTimeout("auto_close(x);",1000) 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.button.value="CLOSE (auto close in "+ x +" sec)";
x--;
setTimeout("auto_close(x);",1000);
} else self.close();
}
and i put onload=auto_close(10)
the problem is that the first time the recursion is called (
setTimeout("auto_close(x);",1000) IE says x is undifined
i dont understand!!
please help, Gordan