I’m trying to use JQuery although i’m struggling to successfully wait for a ajax call to succeed before executing further code. Is there a way to wait for an ajax to call? I’ve seen examples but it seems just to wait blindly for x amount of seconds?
Thanks,
James
Yes, you can do request synchronously:
Source: http://api.jquery.com/jQuery.ajax/
However, synchronous requests are a step backwards, as the JS engine (and, in some browsers, the user interface) will block until the request completes. Douglas Crockford once wrote about synchronous requests: