Monday, July 23, 2007

AJAX request overlapping

I am sure many people of faced the problem of multiple ajax requests overlapping each other's context. In english - when you placed 2 AJAX requests without any delay between them, the AJAX callback function receives only the data from the second request.

This happens due to caching problems in the browsers.

To avoid this i created a stack implementation in Javascript and used the stack to control my AJAX request. Consequently, the AJAX requests went out sequentially rather than all at once, but it was a trade-off i was willing to pay.

No comments: