Thursday, January 12, 2012

Disable jquery in masterpage for a specific content page?


I have this code that warns the user about unsaved changes and it's in the MasterPage of the site I'm working on. I have a search page that doesn't allow the user to save anything and it triggers the unsaved changes warning. Is there a way to disable the code for this one content page?




var _changesMade = false;
$(document).ready(function () {

$('form').bind($.browser.msie ? 'propertychange' : 'change', function () {
_changesMade = true;
});

$(window).bind('beforeunload', function () {
if (_changesMade)
return 'There are unsaved changes which will be lost if you continue.';
});
});

No comments:

Post a Comment