Jump to content

Multiple Ajax requests mix-up


DaveEverFade

Recommended Posts

I have a page using several ajax'ed objetcs (all using the same ajax function). One of the objects loops and does an Ajax refresh every 20 seconds. Unfortunately, somtimes the responses get mixed up and the response from one goes into the incorrect div. I tried to get around it by putting this at the start of my ajax function:

 

XMLHttpRequest=null

 

To make sure there are no current requests but we still get problems.

 

Any ideas?

 

Many thanks

Dave

 

Link to comment
https://forums.phpfreaks.com/topic/46866-multiple-ajax-requests-mix-up/
Share on other sites

Since each request comes back to a JavaScript function call, can't you make a div loading function for refreshing content while all other requests use another callback?  You could also have the response send back data telling your JS its intent is to update the DIV.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.