Name: Anonymous 2007-11-30 21:15
Ok /prog/. I'm trying to make a Greasemonkey script to prevent me from accidentally leaving a certain page.
How would I go about doing this? I'm pretty sure I have to use 'window.onbeforeunload', but I'm not really sure how.
This is what I currently have, which does not work.
window.onbeforeunload = confirmExit;
function confirmExit()
{
return "Are you sure you want to exit this page?";
}
What am I doing wrong?
How would I go about doing this? I'm pretty sure I have to use 'window.onbeforeunload', but I'm not really sure how.
This is what I currently have, which does not work.
window.onbeforeunload = confirmExit;
function confirmExit()
{
return "Are you sure you want to exit this page?";
}
What am I doing wrong?