I need to load html on to a page via jquery ajax. Then, after the html has loaded, I want to parse it for certain data that will be in the loaded html, and use it to create map markers. So I need the load method to act synchronously, so that the html is definitely loaded before my setMarkers() method tries to parse it.
$.when($("#orders").load("datadisp.aspx")).done(function () {
    setMarkers();
});
I thought the current set up that I have is supposed to do exactly that, but I can tell from the debugger that setMarkers() is still being called before the load has completed, because when I put a breakpoint on setMarkers() and inspect the html after it has hit this breakpoint, I can see that the expected html has not loaded yet. Can somebody show me the right way to solve this problem? Thanks.