Does anyone know how to check when a user navigates away from a certain page? Like clicking on a link, or even just closing the browser window. Is there a way to check for this using javascript?
Announcement
Collapse
No announcement yet.
Navigating away from a page
Collapse
X
-
-
-
Bear in mind that the alert/prompt will not differentiate between internal and external links. i.e. It will also be triggered even if the user is navigating to another part of your site.
Originally posted by markhartnady<body onLoad="prompt('Do you wish to continue?');">
Additionally, using a prompt onload is doubly useless as you're really only asking if the user wishes to use the page which has just loaded. Either way, the page has already loaded and the browser won't return them to the previous page even if they decline the prompt.Last edited by Bill Posters; Apr 19, 2006, 05:38 AM.
Comment
Comment