I need to fire some functionality from javascript when a user has finished editing a page and saves it or leaves the editing mode.
Is there a possibility to catch the event?
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It only takes a minute to sign up.
Sign up to join this communityI need to fire some functionality from javascript when a user has finished editing a page and saves it or leaves the editing mode.
Is there a possibility to catch the event?
Use window.onbeforeunload
in edit mode to perform all your operations. Here is how you check edit/display mode
window.onbeforeunload = function (e) {
var message = "Your confirmation message goes here.",
e = e || window.event;
// For IE and Firefox
if (e) {
e.returnValue = message;
}
// For Safari
return message;
};