Skip to main content

Bug Tracker

Side navigation

#3362 closed enhancement ()

Opened September 12, 2008 01:33AM UTC

Closed November 11, 2010 11:09PM UTC

beforeComplete event for $.ajax

Reported by: dalangalma Owned by:
Priority: minor Milestone: 1.3
Component: ajax Version: 1.2.6
Keywords: Cc: dalangalma, flesler
Blocked by: Blocking:
Description

While the complete handler is useful, it fires *after* error and success handlers. It'd be nice to have a version that fires *before* both error and success. That way you could have a common place to do anything that needs to be cleaned up before you fire either the success or error handler.

Attachments (0)
Change History (5)

Changed September 12, 2008 10:45PM UTC by flesler comment:1

cc: → dalangalma, flesler
need: PatchTest Case

Could you provide a test case ? a minimalistic html file with the requires html and js to reproduce the problem.

Thanks.

Changed September 21, 2008 07:40AM UTC by dalangalma comment:2

I'm not sure what you mean - I'm looking for something new. I'd be able to say something like:

$.ajax({
  url: ...,
  data: ...,
  beforeComplete: function() { alert("I fire first"); },
  success: function() { alert("I fire next if the request was successful."); },
  error: function() { alert("I fire next if the request was erroneous."); },
  complete: function() { alert("I fire after either success or error"); }
});

Changed September 09, 2009 04:14PM UTC by robustsolution comment:3

I think no need to have this callback since in case of success the datafilter callback does what you want and in case of error the error callback does what you want

Changed October 14, 2010 03:14AM UTC by snover comment:4

status: newpending

This ticket has been marked as missing a test case. In an effort to reduce the number of outstanding tickets in the bug tracker, it will be closed automatically in 30 days. In order to prevent this from happening, please provide a working test case. If a test case has already been provided and our records are wrong, please respond to the ticket so that it can be fixed. Thank you!

Changed November 11, 2010 11:09PM UTC by trac-o-bot comment:5

status: pendingclosed

Automatically closed due to 14 days of inactivity.