»
EnglishFrenchVietnamese

Print - Auto Popup Window - JavaScriptBank.com

Full version: jsB@nk » Browser » Popup » Auto Popup Window
URL: https://www.javascriptbank.com/auto-popup-window.html

Auto Popup Window © JavaScriptBank.comAutomatically opens a small popup window and closes it after a specified time. Great for displaying important messages without forcing users to close multiple windows! This demo will open a small popup window 3 seconds after the page is loaded and close the window after it has been open for 5 seconds.

Full version: jsB@nk » Browser » Popup » Auto Popup Window
URL: https://www.javascriptbank.com/auto-popup-window.html



JavaScript
<SCRIPT LANGUAGE="JavaScript"><!-- Begin<!-- Original:  Rick Johnson (frj11@ev1.net) --><!-- Web Site:  http://rickjohnson.tripod.com -->function popupWin() {text =  "<html>\n<head>\n<title>Pop Window</title>\n<body>\n";text += "<center>\n<br>";text += "<a href='http://www.javascriptbank.com/' target='_blank'><h2>Over 2000+ free JavaScripts<br>at JavaScriptBank.com</h2></a>";text += "</center>\n</body>\n</html>\n";setTimeout('windowProp(text)', 3000); // delay 3 seconds before opening}function windowProp(text) {newWindow = window.open('','newWin','width=300,height=100');newWindow.document.write(text);setTimeout('closeWin(newWindow)', 5000);// delay 5 seconds before closing}function closeWin(newWindow) {newWindow.close();// close small window and depart}//  End --></script><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->


HTML
<BODY onLoad="popupWin()"></BODY><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->