Replying to [comment:7 scott.gonzalez]:
Thanks dmethvin and scott for your valid suggestions.
After removing the code lines where it was modifying the object it was not owning, I started getting the following error:
"Message: Object doesn't support this property or method
Which clearly indicated that we are getting close to the problematic part of the code. The error in line 975 is related to Defferred Objects section in the file jquery-1.5.2.
In my code I call the $.ajax (to send the next request), in either "success" callback or in the "error" callback in a specific case. Sometimes in a ajax request cycle (interval of 1.5 sec), I have to send ~3 requests in sequence. My doubt here was, the next request might have been sent before the previous was "complete". Could this be a problem? Can't the "success" or "error" callbacks or the ajax object be queued in jquery?
Now I have changed the implementation: In each request cycle I have implemented a loop, using SetTimeout (async delay) to check whether the previous request is "complete" and if compelete it sends the next request.
I have implemented "beforeSend" and "complete" callback to check the status of the request using a flag say, "ajax-in-progress"(var).
Do you think calling the ajax in chain is a problem? Though it was called only after the event "success" or "error". Can you please clarify.
Thanks a lot!