how to hook up default beforeunload event on an aspx page ?

Posted by Nikhil Vaghela on Stack Overflow See other posts from Stack Overflow or by Nikhil Vaghela
Published on 2010-05-17T07:00:53Z Indexed on 2010/05/17 13:40 UTC
Read the original article Hit count: 371

I have a custom web part placed on one of the application page in SharePoint. This page it seems already have a function which gets executed on windows beforeunload javascript event.

My problem is that i too need to execute some client side code (to prompt user for any unsaved changes in my web part) on windows beforeunload event.

How can i achieve this ? I mean let the default event be fired as well as call my function also ?

Appreciate any help.

Nikhil.

© Stack Overflow or respective owner

Related posts about javascript-events

Related posts about JavaScript