The SitePoint Forums have moved.

You can now find them here.
This forum is now closed to new posts, but you can browse existing content.
You can find out more information about the move and how to open a new account (if necessary) here.
If you get stuck you can get support by emailing forums@sitepoint.com

If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Threaded View

Ajax: Retrieving data from multiple XML files

Hi everyone,

I have a function that loops through a list of objects, and for each one makes an Ajax request to load an XML file, and fill a couple of the objects variables with elements from that XML file. The problem is that when execute, the function only fills one or two of the objects. I am assuming this has something to do with the function being called multiple times in a row and not having a chance to finish the previous call. If this is the case, is there a way to force the code to pause while it waits for the previous one to execute fully?

In my real code there could be 100+ objects. When it loops through and displays the styles, it is only showing up for the last one when run locally. If run from the server, it might show one more in the middle somewhere.