2

I use JQuery. There is a widget based application. There are multiple widgets on single page. Every widget contains N number of ajax request while loading the widgets.

How can i capture the event when result of all ajax request are received? Is there any way without timer?

1

1 Answer 1

4

The foolowing jquery method will be called on complete of every ajax request. If you know the number of ajax requests. so you can have a global variable and increment it on every call until it reaches the desired value and then trigger your desired event

var i=0; $("body").ajaxComplete(function(event,request, settings) { if(i==MAX_REQ){ alert("done all"); } else { i+=1; } 

});

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.