Exit pop script

Status
Not open for further replies.

Ben89

New member
Mar 30, 2007
670
4
0
My AM sent me this exit pop code to be placed before </body> but no message pops up after closing the page. Any of you javascript guys have some input on how to make this script functional?

Thanks.

window.onbeforeunload = fget
var mouseX,mouseY;
document.onmousemove=mtrack;
function mtrack(e) {
if (!e) {e=event}
if (e.clientX!=null){
mouseX=e.clientX;
mouseY=e.clientY;
}
}

function fget() {
if (typeof(event)=="object") {
mouseX=event.clientX;
mouseY=event.clientY;
}
if (mouseY<10 && mouseX>400) {
alert("Don't go!");
window.location="http://google.com";
return "Click CANCEL to stay!";
}
}
 


That wasn't a stupid question. It was my problem. Works fine now.

Thanks a lot bubbles!
 
Status
Not open for further replies.