Help - Search - Members - Calendar
Full Version: Now Leaving
Zymic Webmaster Forums > Web Design & Development > Client Side Scripting > JavaScript
DjLowse
How do you make a " You Are Not Leaving _____ " page ???? blink.gif
k.digennaro
QUOTE(DjLowse @ Sep 16 2010, 10:30 PM) *
How do you make a " You Are Not Leaving _____ " page ???? blink.gif


Welcome to the forums DjLowse, next time please make sure you post your topic in the right thread. I'm not sure exactly what you are trying to do maybe you could link us to an example?

Best Regards,
Kevin DiGennaro
IamShipon1988
Let me see if I know what your talking about. You want to show a message that possibly pops up in a light box or message box stating you are leaving my site when they click on an external link (link not on your site/server)? If so, you can find something similar to what your looking for here: http://www.w3schools.com/js/js_whereto.asp
EvilMastermindsProgram
Do you mean this: --?
CODE
<script type="text/javascript">
window.onbeforeunload=youAreNowLeaving;
function youAreNowLeaving()
{
return ("You are now leaving this page...");
}
</script>


When you leave the page, the dialog box picture that I attached will show up (assuming you have windows 7)...

Or do you mean a page that you can't close?
Doing the second thing is impossible, but you could try:
CODE
window.onbeforeunload=youAreNOTLeaving;
function youAreNOTLeaving()
{
window.open(window.location.href);
}

Whenever you try to close the window, the same page pops up.....
I DO NOT reccomend doing this because it will annoy dry.gif dry.gif your users......
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2013 Invision Power Services, Inc.