Bug Tracker

Ticket #3957 (closed bug: invalid)

Opened 6 years ago

Last modified 3 years ago

endless loop in jquery.post

Reported by: atlithorn Owned by:
Priority: major Milestone: 1.3.2
Component: ajax Version: 1.2.6
Keywords: Cc:
Blocking: Blocked by:

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

Change History

comment:1 Changed 6 years ago by dmethvin

Can you attach a simple test case that demonstrates the problem, or post a link to one on your site?

comment:2 Changed 6 years ago by atlithorn

My apologies, please disregard. Not a jQuery bug.

comment:3 Changed 6 years ago by dmethvin

  • Status changed from new to closed
  • Resolution set to invalid
Note: See TracTickets for help on using tickets.