Skip to main content

Bug Tracker

Side navigation

#7422 closed bug (fixed)

Opened November 06, 2010 05:04AM UTC

Closed November 09, 2010 05:41PM UTC

Ajax abort() regression for IE in jQuery 1.4.3 (through 1.4.4rc2)

Reported by: buymeasoda Owned by: snover
Priority: blocker Milestone: 1.4.4
Component: ajax Version: 1.4.3
Keywords: regression Cc:
Blocked by: Blocking:
Description

There appears to be a regression with the Ajax abort() implementation in jQuery 1.4.3 through 1.4.4rc2. Ajax abort() works unexpectedly for Internet Explorer 7 (I believe it also exhibits the same unexpected behaviour in IE6). IE8 works correctly, IE9 was not tested.

Details: In-progress ajax request objects (stored in a variable) should be cancellable with the abort() method and not impact subsequent ajax requests.

Test case: To simulate ajax requests that are fired and aborted based on external actions, I created a loop that fires 10 ajax requests to fetch data from a simple script on the server that has a 1 second sleep. Each of these 10 requests is aborted, except the final request.

Expected / previous behaviour: The browser should fire 10 requests, immeadiately abort 9 and then complete the 10th request, therefore displaying the server response after 1 second.

Issue: In jQuery 1.4.3 and 1.4.4rc2, Internet Explorer displays the server response after 10 seconds (the total time of the requests added together), instead of 1 second. In jQuery 1.4.2, IE displays the response, as expected, after 1 second.

Sample JavaScript code:

var ajax;

for (var i = 0; i < 10; i++) {
	ajax = $.ajax({
		url: 'data.php',
		cache: false,
		success: function(data) {
			$('body').append(data);
		}
	});
	if (i < 9) {
		ajax.abort();
	}
}

Sample data.php file:

<?php
sleep(1);
?>
Data from server
Attachments (0)
Change History (2)

Changed November 06, 2010 07:14PM UTC by snover comment:1

component: unfiledajax
keywords: → regression
milestone: 1.51.4.4
owner: → snover
priority: undecidedblocker
status: newassigned

Changed November 09, 2010 05:41PM UTC by john comment:2

resolution: → fixed
status: assignedclosed

Pulled in.