I have a JavaScript function that makes two consecutive Ajax requests using jQuery. I want to make sure that the first request has loaded before the second function is call
Using jQuery the simplest way is like this:
$.ajax({ type: "POST", url: "some.php", success: function(msg){ $.ajax({ type: "POST", url: "some2.php", success: function(msg){ alert( "End of second call" ); } }); } });