Hello I have some functions written in a JS file that I need help with, I have three methods structured like so:
writeDetailsToDB(); //writes details to db and returns a status to indicates success
writeOtherDetailsToDB(); //writes details to db and returns a status to indicates success
checkOk(); //checks to see both status were successful
The problem I am having is that the checkOk()
is being called before the other two methods can finish executing so it always indicates failure I need to be be able to wait for the other two methods to finish before executing checkOK()
. Having looked a AJAX success methods I always find an .ajax() method and URLs and I don't see how they fit my problem.
Please can someone help me!