Suppose that I have some global Ajax event handlers defined (ajaxStart, ajaxStop, and ajaxError). Usually I am fine with that, but for one request, I want to disable the aja
When you look at this if statement from the jquery/ajax source https://github.com/jquery/jquery/blob/master/src/ajax.js#L579-582 , which is one of many of the same kind, it is clear that your problem can not be solved by a jquery parameter alone.
My suggestion would be to:
set global to false, like Vaibhav Gupta said
map your global handlers to local in the specific ajax call and trigger the global event through the $.event.trigger method
Sample:
$.ajax({
url: "test.html",
global: false,
beforeSend: function(){$.event.trigger('ajaxStart');},
complete: function(){$.event.trigger('ajaxStop');},
error: your_error_handler
});