Make sure first ajax function finishes before second one
Either specify async: false
in the $.ajax
options, or make the second ajax call in the complete
callback of the first call.
Either specify async: false
in the $.ajax
options, or make the second ajax call in the complete
callback of the first call.