views:

112

answers:

3

Hello,

Google Docs, Gmail etc have this feature where if you try to leave a page that hasn't been saved it pops a dialog box with "confirm, Are you sure you want to navigate away from this page?"

Is there a JQUERY plugin that will allow me to implement this kind of functionality?

Thanks

+1  A: 

window.onbeforeunload; it does appear that there are efforts to Standardize the event between browsers too: http://kenbrowning.blogspot.com/2009/01/using-jquery-to-standardize.html

Jonathan Sampson
+2  A: 

You need to look at the window.onbeforeunload event, which is not supported in all browser, so don't count on it.

Here's the MS documentation for it - it was originally an IE only event.

jball
A: 

I just found this which seems to be an elegant solution too: http://www.jonstjohn.com/node/23

AnApprentice