Several times, I've heard people how to detect someone leaving a page BEFORE they actually leave... In Internet Explorer, you can use this!!!
From:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE>onbeforeunload Sample</TITLE>
<SCRIPT>
function closeIt()
{
event.returnValue = "Any string value here will force a dialog box to appear before closing the window.";
}
</SCRIPT>
</HEAD>
<BODY onbeforeunload="closeIt()">
<H1>onbeforeunload Sample</H1>
<P>This example uses the onbeforeunload event to ask users whether they want to remain on the current page
or navigate to a new URL. When the user clicks on the hyperlink or attempts to close the browser window,
the onbeforeunload event fires on the body and a dialog box appears. If the user chooses 'OK',
the page navigates to the new URL ( or closes the window;
if the user chooses 'Cancel', the page remains the same.</P>
<a href=" here to navigate to </BODY>
</HTML>
Programming today is a race between software engineers striving to build better and bigger idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rick Cook (No, I'm not Rick)
From:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE>onbeforeunload Sample</TITLE>
<SCRIPT>
function closeIt()
{
event.returnValue = "Any string value here will force a dialog box to appear before closing the window.";
}
</SCRIPT>
</HEAD>
<BODY onbeforeunload="closeIt()">
<H1>onbeforeunload Sample</H1>
<P>This example uses the onbeforeunload event to ask users whether they want to remain on the current page
or navigate to a new URL. When the user clicks on the hyperlink or attempts to close the browser window,
the onbeforeunload event fires on the body and a dialog box appears. If the user chooses 'OK',
the page navigates to the new URL ( or closes the window;
if the user chooses 'Cancel', the page remains the same.</P>
<a href=" here to navigate to </BODY>
</HTML>
Programming today is a race between software engineers striving to build better and bigger idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rick Cook (No, I'm not Rick)
