I tried this code before window close.But again i get a pop up like This
page is asking you to confirm that you want to leave - data you have
entered may not be saved.Two pop-ups are not needed.
window.onbeforeunload = function() {
var r=confirm(Are you sure you want to navigate away?);
if
On 11 March 2011 01:17, joe t. thooke...@gmail.com wrote:
One note on TJ's post, hopefully helpful:
You cannot CANCEL the unload event. If i understand them correctly,
load and unload are the only native events that can't be canceled from
scripts. You can perform other actions, but unload
T.J. Crowder t...@crowdersoftware.com wrote:
Yes, you can run functions using the window unload event. Example:
http://jsbin.com/apuke4
Open that link in a tab, click Open Window, then close the tab you
opened the link in -- the subordinate window closes as well.
What you can do in those
On Mar 11, 2011, at 7:41 AM, Bertilo Wennergren wrote:
Here's a limitation with beforeunload (in case someone hasn't
heard):
More of less the only thing you can do with beforeunload, is to ask
the user if he or she really wants to leave the page. A dialog
will appear, and the user can choose
Here's a sample from code that i wrote and seems to work ok (at least,
last i tested it, i no longer work there), adapted for generics:
http://pastie.org/1661648
So here's what i learned, now that my curiosity got roused...
The beforeunload event will automatically generate the prompt. If you
On Mar 11, 2011, at 7:50 PM, joe t. wrote:
Here's a sample from code that i wrote and seems to work ok (at least,
last i tested it, i no longer work there), adapted for generics:
http://pastie.org/1661648
So here's what i learned, now that my curiosity got roused...
The beforeunload event
On Mar 10, 2011, at 2:25 AM, T.J. Crowder wrote:
What you can do in those functions is severely limited by modern
browsers (for all the good reasons you can think of). You can't open
new windows, do alerts/confirms
Thanks. This is the part I was remembering -- someone wanted an Are
You
One note on TJ's post, hopefully helpful:
You cannot CANCEL the unload event. If i understand them correctly,
load and unload are the only native events that can't be canceled from
scripts. You can perform other actions, but unload means the browser
has been committed to unloading that page,