Side navigation
#3957 closed bug (invalid)
Opened January 22, 2009 03:29PM UTC
Closed February 15, 2009 06:00PM UTC
Last modified March 14, 2012 11:33AM UTC
endless loop in jquery.post
Reported by: | atlithorn | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | 1.3.2 |
Component: | ajax | Version: | 1.2.6 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
If you call jquery.post in a success callback for an earlier jquery.post you end up in an endless loop. The data provided in each success callback is the same as in the first request.
My example was posting data that was possibly invalid and the succcess callback asked for user validation that they really meant to post the data. If the user confirmed then a new jquery.post was fired. The success callback for that jquery.post was immediately called with the same data as in the original request which then asked for user confirmation again. The second jquery request (with user acceptance flag) is sent off but that callback is never fired until the user asks to cancel :)
My workaround was to break the execution thread by calling the second jquery.post via window.setTimeout
Can you attach a simple test case that demonstrates the problem, or post a link to one on your site?