Reputation: 17655
Is there a way to detect when one of the plugins successfully completes ajax call using $.ajax. I am using a treeview plugin that calls asp.net webservice, and I want to attach context menu to the branches/leafs once they've been loaded.
Upvotes: 1
Views: 2052
Reputation: 268492
Have you looked into $.ajaxComplete();
, $.ajaxSuccess();
, or the callback functions within the requests themselves:
$.post("somepage.php", {var:"val"}, function(results) {
/* this is the callback, which happens after the response is received */
alert(results);
});
Take a look at the other Global Ajax Event Handlers.
Upvotes: 2
Reputation: 947
Use the "success" function
$.ajax({
type: "POST",
url: "some.php",
data: "name=John&location=Boston",
success: function(msg){
//the action to be done when the call is complete
}
});
Upvotes: 0