Side navigation
#265 closed bug (fixed)
Opened October 10, 2006 12:49PM UTC
Closed October 13, 2006 02:02PM UTC
Last modified June 19, 2007 07:44AM UTC
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" );
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.