endless loop in jquery.post
|Reported by:||atlithorn||Owned by:|
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