Forum Moderators: open
Any thoughts?
-s-
<!--____________begin pop-behind code____________-->
<script language="JavaScript">
<!-- Hide script from older browsers
{myWin = open('', 'winin','top=10,left=10,toolbar=0,menubar=0,scrollbars=1,status=0,resizable=1,width=650,height=460');
myWin.blur();
myWin.location = 'http://wwWebmasterWorldebsite.com/window/2nd/mysite/index.html';}
// end hiding contents -->
</script>
<!--____________end pop-behind code____________-->
var timeoutID = setTimeout(code, delay);
code is a string containing the code to be executed, delay is the delay in milliseconds. You don't need to store the return value unless you need at some point to cancel the timeout.
var timeoutID = setTimeout("popUpWindow();", 5000);
...will wait five seconds before executing the code. To cancel the timeout, use the clearTimeout function:
clearTimeout(timeoutID);
Related to setTimeout is setInterval. It executes the code periodically:
var intervalID = setInterval("popUpWindow();", 5000);
...will execute the code every five seconds (which would really annoy). To cancel, use
clearInterval(intervalID);