How to make functions run after ajax loop is completed
I work on a google map where information about vehicles is loaded via ajax when the page is loaded. This means that all relevant information about the vehicles is stored locally in a jquery container and updated every 30 seconds.
Unfortunately I have discovered that if many devices are loaded some other functions are called before they are all loaded which gives null pointer exceptions.
what is the smartest way not to make the other functions run until after the the above mentioned ajax call has run.
I have tried the
$.when( loadVehicleInfo() ).done(function()
but this seems only to work on the functin itself - it does not wait till the ajax call is completed.
Setting async to false seems also to be a very bad solution.