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.
2 Answers
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.
1 Comment
epitka
Awesome, I was about to modify the script to create custom event in the plugin.
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 } }); 1 Comment
epitka
I cannot use success function, one plugin does not know about the other one.