Javascript examples for Browser Object Model:Window setTimeout
Use setTimeout to close a window
<html> <head> <title>Pandora</title> </head> <body onload="pandoraFunction(); setTimeout('closeFunction()', 3000)"> <script> function pandoraFunction() { window.open('http://www.java2s.com','window','menubar=yes,screenX=0,screenY=0,top=0,left=0,location=no,status=no,toolbar=no,scrollbars=yes,resizable=no,width=' + (screen.width - 10) + ',height=' + screen.availHeight); }//from w w w . j a va 2 s . co m function closeFunction() { window.close() } </script> </body> </html>