Overwrite ajaxComplete for particular ajax request
My application has a ajaxComplete() which is defined开发者_运维百科 in a generic .js file loaded in every view page. How can I overwrite this or better still avoid running it for specific $.ajax() call.
Set global: false
in your $.ajax
call.
From the API:
Whether to trigger global Ajax event handlers for this request. The default is true. Set to false to prevent the global handlers like ajaxStart or ajaxStop from being triggered.
Your call will look something like this:
$.ajax({
url: 'http://example.com/',
data: data,
global: false,
success: function() {
}/* etc... */
});
精彩评论