[jQuery] Re: Call a function just before the window close

2008-02-23 Thread rics
Can't put it to work... :( I found an example, but it doesn't work too. Maybe because I'm in firefox, on linux.. don't know. I'm trying the .unload() jquery event now... On Feb 22, 6:27 pm, MorningZ [EMAIL PROTECTED] wrote: there is an onbeforeunload event you can use

[jQuery] Re: Call a function just before the window close

2008-02-23 Thread Dave Stewart
I couldn't bind 'beforeunload' to the window. document, or body tag successfully. I had to revert to a manual 'window.beforeunload'. I know I should be doing something like evt = window.attachEvent ? window.attachEvent('onbeforeunload', fn) : window.addEventListener('beforeunload', fn, false)

[jQuery] Re: Call a function just before the window close

2008-02-23 Thread Dave Stewart
Well you know - try as I like, I could NOT get the DOM method addEventListener to work for beforeunload. Doing it the old way: window.onbeforeunload = function(){ return Are you sure? }

[jQuery] Re: Call a function just before the window close

2008-02-23 Thread Dave Stewart
Sorry - text got cut off: Doing it the old way: window.onbeforeunload = function(){ return Are you sure? } Worked great.

[jQuery] Re: Call a function just before the window close

2008-02-22 Thread MorningZ
there is an onbeforeunload event you can use http://www.google.com/search?q=javascript+onbeforeunloadie=utf-8oe=utf-8aq=trls=org.mozilla:en-US:officialclient=firefox-a