Abdul Ahmad
Abdul Ahmad

Reputation: 10021

jQuery.ajaxcomplete check where ajax occurred

I have an event:

$(document).ajaxComplete

which works fine. However, I want to check if ajax occurred at a specific location in the document. Is there a way to check which ajax call occurred?

$(document).ajaxComplete(function() {
 if (???) //code
 else //code
}

Upvotes: 0

Views: 264

Answers (1)

HAMED
HAMED

Reputation: 353

I think the only way is to define success function for each ajax function like this :

$.ajax({
    url: "...",
    success: function(html){
        //if success
    };
});

Upvotes: 2

Related Questions