Entry
I would like to make a message pop up when the user tries to exit a page saying please logoff properly, then return to the original page. How?
Mar 26th, 2001 07:24
Jean-Bernard Valentaten, Martin Tuncaydin,
Try adding this little sample to your page:
function dontLeave() {
var tmp = window.location.pathname;
alert('Please logoff properly');
location.href = tmp;
}
and then have it fired by the eventhandler:
<body onunLoad="dontLeave();">
You might have to dynamically have the body-Tag rewritten by the logoff-
function, else you won't be able to leave the page :)