#265 closed bug (fixed)
Some variables are not initialized properly in jQuery.ajax in 1.0.2
Reported by: | Jan | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | |
Component: | ajax | Version: | |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
The variables success
, error
, dataType
, global
and timeout
are only initialized properly if theres only one argument passed to jQuery.ajax
as object.
if ( !url ) { ret = type.complete; var success = type.success; var error = type.error; var dataType = type.dataType; var global = typeof type.global == "boolean" ? type.global : true; var timeout = typeof type.timeout == "number" ? type.timeout : jQuery.timeout; var ifModified = type.ifModified || false; data = type.data; url = type.url; type = type.type; }
Otherwise, for example global
is undefined and no ajax events are triggered
if ( global && ! jQuery.active++ ) jQuery.event.trigger( "ajaxStart" );
Change History (2)
comment:1 Changed 16 years ago by
comment:2 Changed 16 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
global and timeout options are now initialized properly when $.ajax is called internally (argument list instead of hash). Fix in SVN.
Note: See
TracTickets for help on using
tickets.
Good catch. This prevents to global handlers to work when $.ajax is not called directly.
Another good reason to synchronize both internal and external $.ajax API.