Bug Tracker

Opened 12 years ago

Closed 12 years ago

Last modified 11 years ago

#8338 closed bug (wontfix)

ajaxStart and ajaxStop events not working for 1.5.0

Reported by: [email protected] Owned by:
Priority: low Milestone: 1.next
Component: ajax Version: 1.5
Keywords: Cc:
Blocked by: Blocking:


  • Affected Version: 1.5.0
  • Browser: Firefox 3.6.13
  • Mozilla/5.0 (Windows; U; Windows NT 6.1; de; rv: Gecko/20101203 Firefox/3.6.13 ( .NET CLR 3.5.30729; .NET4.0C)
  • Operating System: Windows 7

Hi... Given the following test case http://jsfiddle.net/N3nAe/

using global ajaxStart+ajaxStop event handlers works perfectly fine with jQuery 1.4.4.

Expected Result: Alert dialogs should popup for ajaxStart and ajaxStop events.

When switching to jQuery 1.5.0 the same handlers are not processed any longer.

Am I missing here something essential ?

Regards Metin

Change History (3)

comment:1 Changed 12 years ago by jaubourg

Resolution: wontfix
Status: newclosed

This is because you're doing a JSONP request.

JSONP requests are not guaranteed to complete (because errors are not caught). jQuery 1.5 forces the global option to false in that case so that the internal ajax request counter is guaranteed to get back to zero at one point or another.

If you want all requests to fire the events, no matter what (and at the risk of the same inconsistencies 1.4.4 exhibited), you can use the following prefilter:

jQuery.ajaxPrefilter(function( options ) {
    options.global = true;

Case in point: http://jsfiddle.net/X4JTx/

comment:2 Changed 12 years ago by jitter

Component: unfiledajax
Priority: undecidedlow

comment:3 Changed 12 years ago by leods92

@jaubourg or another expert Could you point out exactly what are the inconsistencies? I need to monitor when some JSONP calls start/end and the easier way would be using ajaxStart() and ajaxStop(). However, I'm afraid something bad might happen as you said and therefore I'd like to know what risk I'll run if decide to use the prefilter.

Thank you in advance, Leonardo.

Note: See TracTickets for help on using tickets.