I have an "if statement" like so:
if (webservice returns true) {
alert("booyah");
}
alert("hooray");
Trouble is that the webservice is very slow. And "hooray" gets triggered before "booyah" even when the webservice returns true.
How can I pause all further processing until this "if statement" is properly evaluated?
I'm thinking that some kind of callback function might be needed here. How will I structure it?
Additionally, is there some way to have a wait animation on the webpage while this "if statement" is being waited on?