PDA

View Full Version : Firefox 7: custom exit confimation message not working



kohkindachi
10-03-2011, 12:29 PM
Hey guys these code below works on chrome and IE and the older version of FF. But not working on the latest (firefox is showing their own alert instead)....can something be done?


<script language="JavaScript">
var allowConfirm = true;
window.onbeforeunload = confirmExit;
function confirmExit()
{
if(allowConfirm)
return "You're about to be redirected"+ '\n'+ "IF this is UNIntentional --- Kindly click [CANCEL]/[Stay on Page]";
else
allowConfirm = true;
}
</script>

rangana
10-03-2011, 12:37 PM
I'm on Firefox 7 and it works fine.

kohkindachi
10-03-2011, 03:07 PM
I'm on Firefox 7 and it works fine.

can you show me your test page? or can you make a screenshot?

rangana
10-03-2011, 03:21 PM
Attached

kohkindachi
10-03-2011, 03:40 PM
Attached

lol. That's the reason for me to be posting here. That's their DEFAULT message not my customize message. Did you read the code bro :)

rangana
10-03-2011, 04:09 PM
My apologies if I missed your point but there's no good in you being sarcastic when you're asking for assistance.

Anyway, please read the specs. It's mentioned there:
https://developer.mozilla.org/en/DOM/window.onbeforeunload



Note that in Firefox 4 and later the returned string is not displayed to the user. See Bug 588292.

kohkindachi
10-04-2011, 08:13 AM
I'm not being sarcastic lol Thanks anyway rangana :)
so there's no workaround?