Bug Tracker

Opened 10 years ago

Closed 10 years ago

#14053 closed bug (notabug)

ajaxStart Event is ignored for the first time when ajax function is called from JQuery

Reported by: Hrishikesh Moundekar <[email protected]…> Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 1.8.3
Keywords: Cc:
Blocked by: Blocking:


The ajaxStart Event is ignored for the first time when ajax function is called from JQuery.

Below is the sample code which ran with JQuery 1.8.3


type : 'get', url : 'tasks.json', dataType : 'json', });



}); $(this).ajaxStop(function(){



when you run this code... for the first time the ajaxStart event will be ignored and direct ajaxStop event will be called.. but for all other successive call's the ajaxStart event is also getting triggered... Basic Investigation based of JQuery 1.8.3 version :

below code inside trigger function is avoiding ajaxStart event to get executed and this is because for the first time when we trigger ajaxStart event its not present under jQuery.event.global Array list..

if ( (!elem
jQuery.event.customEvent[ type ]) && !jQuery.event.global[ type ] ) {

No jQuery handlers for this event type, and it can't have inline handlers

return; }

Change History (2)

comment:1 Changed 10 years ago by Hrishikesh Moundekar <[email protected]…>

The issue is more or less same as Ticket #11038 - PROBLEM WITH AJAXSTART IN 1.7.1.. which is closed without resolution

Thanks, Hrishi

comment:2 Changed 10 years ago by dmethvin

Resolution: notabug
Status: newclosed

See the jQuery 1.9 upgrade guide. The event is only fired on document. Also use the jQuery Migrate plugin.



Note: See TracTickets for help on using tickets.