Skip to content Skip to sidebar Skip to footer

Problems With Onbeforeunload

I have problem with onbeforeunload and preventing user from exit the page: When user want to exits i want to redirect him on other page, without any warning or pop-up I try to popU

Solution 1:

Browsers disallow that sort of behavior since it's normally a very unpleasant thing for the user.

Solution 2:

Yes, i know this is unpleasant, but it is mainly internal page, so it is targeted group of users ( i hate popups to). One way i found was just redirect user on other page with message "are you realy want to leave page" (of course he want if he go away, but this is some strange fSpec)

Solution 3:

You can use this code: window.onbeforeunload = function() { return "MyMessage"; }

Post a Comment for "Problems With Onbeforeunload"