I have 2 scripts
script1 = function() {
// takes very long time
}
script2 = function() {
// takes less time
}
I want to ensure that script2 should run after script1 is complete.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
put your script2 to script1. Or for more general solution make script1 function to receive callback function(script2) and call it.
This is the way of many many jquery async functions