javascript - How to open just one popup? -


i have javascript code :

function call() {     popup = window.open('http://www.google.co.in');     settimeout(wait, 5000); }  function caller() {     setinterval(call, 1000); }  function wait() {     popup.close(call, 1000); } 

and have html code:

<body onload="caller();">` 

and opens infinity of popups

i don't know how open 1 popup, not infinity of files.

when caller() function runs, calls call function using setinterval, run on ad infinitum.

instead, change this:

setinterval(call, 1000); 

to this:

settimeout(call, 1000); 

this calls once, after 1 second.


Comments

Popular posts from this blog

shopping cart - Page redirect not working PHP -

php - How to modify a menu to show sub-menus -

python - Installing PyDev in eclipse is failed -