Skip to main content

Bug Tracker

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" );
Attachments (0)
Change History (2)

Changed October 10, 2006 06:52PM UTC by joern comment:1

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.

Changed October 13, 2006 02:02PM UTC by joern comment:2

resolution: → fixed
status: newclosed

global and timeout options are now initialized properly when $.ajax is called internally (argument list instead of hash). Fix in SVN.