I am using jQuery 1.7.2 and try to throw a 'isDirty' flag to a certain message I am being called an AJAX call. If the user clicks, then the proper AJAX call should be done and if they cancel the confirmation message then the AJAX call should not be placed and the user should leave the page. My page has the following functions
... $ (function () {$ (document) .JaxStart (function () {if (isDirty) {var status = Confirm (you save There are no changes! Are you sure you want to continue? ';; If (position) {is back;} return status;} true truth;}); ...}); and .jaxStart is never being called if I change .jaxStart with Ajax, then it is called, but if I cancel the confirmation and 'false' If the function is returned, then it loads the AJAX request too.
Create an AJAX query and cancel it immediately It is not a good idea. You should test your AJAX query before preparing it.
I suggest you create a custom AJAX function, JPL wrapped one where you can check your flag and launch a query after verifying the user.
var ajaxSecure = function () {iframe} {var status = confirm ('you have unsaved changes! Do you really want to continue?'); If (status) {isDirty = false; } And {return tap; }} Return $. Ajax (argument); }; and then use your ajaxSecure () instead of $ .ajax ().
Comments
Post a Comment