I have a couple functions that make multiple delete calls to social media APIs, and I need to know when all of them are finished. I'm using Parse Cloud Code to make these calls, and I'm not sure if they use AJAX. I tried the ajaxStop method as described here: Waiting on multiple asynchronous calls to complete before continuing but nothing came up. I did a simple
$(document).ajaxStart(function(){
console.log("ajax calls started");
});
but nothing came up in my console for that either.
$('#delete').click(function(){
$(function(){
$(document).ajaxStop(function(){
$(this).unbind("ajaxStop");
console.log("All calls finished");
});
deleteTwitter();
deleteTumblr();
});
});
I'm not sure how else to go about this, also, NodeJS isn't an option. I'd really appreciate some insight on this, whether it's knowledge about Parse Cloud Code or just something I'm misunderstanding about how AJAX works. Thank you.