I have functions that do AJAX requests, how can I make these functions execute in order they are called in JavaScript?
function1(); // some
function2(); // AJAX
function3(); // happens
function4(); // in
function5(); // each function
I want function2 to wait until function1 is complete and function3 to wait until function2 is complete and so on...