Hi, On close of the main window, I want to popup a small window. The main window can be closed by the cross button on the right most side of the browser or by javascript window.close() or by ALT F4 key of the key board. How to catch this close event and pop up a new window. Regards Pashi.
Anonymous
Ranch Hand
Joined: Nov 22, 2008
Posts: 18944
posted
0
use window.document.onunload=new window("","",""); write this in the head section, just before body..
Chris Baron
Ranch Hand
Joined: Mar 21, 2003
Posts: 1028
posted
0
use window.document.onunload=new window("","",""); write this in the head section, just before body..
...and loose visitor by visitor for ever
Pashi Soni
Greenhorn
Joined: Feb 27, 2003
Posts: 26
posted
0
Hello, I tried the code, but instead of poping a new window on unload, it is loading on load. So it is not working properly. Please Help. !! thanx Pashi
Chris Baron
Ranch Hand
Joined: Mar 21, 2003
Posts: 1028
posted
0
Hi Pashi <body onUnload="window.open( ' ', ' ', ' ' )"> but if you pop up advertising, better use <body onLoad="history.back()"> [ May 08, 2003: Message edited by: Christian Baron ]
Pashi Soni
Greenhorn
Joined: Feb 27, 2003
Posts: 26
posted
0
Thanx now it is working perfectly.
Eric Pascarello
author
Rancher
Joined: Nov 08, 2001
Posts: 15003
posted
0
Hey have you tried to use a link on your page that you have this code on??? LOL...I would do it if I were you!