Overwrite ajaxComplete for a specific ajax request

My application has ajaxComplete (), which is defined in a common .js file uploaded to each view page. How can I rewrite this or even better not run it for a specific call to $ .ajax ().

+3
source share
1 answer

Set global: falseto your $.ajaxchallenge.

From the API :

Whether to run global Ajax event handlers for this request. The default value is true. Set to false to prevent global handlers such as ajaxStart or ajaxStop from starting.

Your call will look something like this:

$.ajax({
    url: 'http://example.com/',
    data: data,
    global: false,
    success: function() {

    }/* etc... */
});
+5
source

Source: https://habr.com/ru/post/1786258/


All Articles