Mobile app version of vmapp.org
Login or Join
Smith883

: When does FireFox ask for confirmation on page redirect? Every once in a while I click a link and see the following (I'm using FF 11.0): I was wondering why FF does this on some redirects/links

@Smith883

Posted in: #Firefox #Forms #Post #WebDevelopment

Every once in a while I click a link and see the following (I'm using FF 11.0):



I was wondering why FF does this on some redirects/links and not on others. I was thinking maybe it does that when you're on a page that contains a <form> element?

Thanks for any help here/

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Smith883

1 Comments

Sorted by latest first Latest Oldest Best

 

@Carla537

It's done with JavaScript, using the window.onbeforeunload event (Mozilla, IE).

Some browsers will even let you specify (part of) the text in the dialog box by returning a string from the event handler, but for security reasons, recent versions of Firefox (which you appear to be using) will ignore the string and just always present the same fixed message.

Here's some example code from the MDN page:

window.onbeforeunload = function (e) {
e = e || window.event;

// For IE and Firefox prior to version 4
if (e) {
e.returnValue = 'Any string';
}

// For Safari
return 'Any string';
};

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme