Trick to Open a New Page When Closing a Website Page or in other words Create a New Tabulation When Closing a Website
We sometimes find that when we want to close a web page by clicking the x in the upper right corner of the window, what happens is that a new window opens. Usually this concept is found on web pages that contain advertisements for a product. The concept is almost the same as opening a popup window in the previous discussion, only the placement of the javascript function call is different. Here is the source program:
<html>
<head>
<title> </title>
<script>
<!-- Begin function popUp(URL) { day = new Date(); id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "',
'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=250,height=250,left = 304,top = 150.5');");
}
// End -->
</script>
</ head >
<body onunload="javascript:popUp('popup.html')">
Tutup halaman web ini maka akan terbuka window baru secara otomatis </ body >
</html>
Note on the <BODY BGCOLOR="#FFFFFF" onunload="javascript:popUp('popup.html') ">
properties tag: onunload is what calls the javascript function to open the popup.html page when the main browser window is closed. Therefore we prepare the popup.html file, can be taken from the popup.html source file above. note: runs well on IE browser.