Bug Tracker

Modify

Ticket #7422 (closed bug: fixed)

Opened 3 years ago

Last modified 3 years ago

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:
Blocking: Blocked by:

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

Change History

comment:1 Changed 3 years ago by snover

  • Status changed from new to assigned
  • Component changed from unfiled to ajax
  • Priority changed from undecided to blocker
  • Owner set to snover
  • Milestone changed from 1.5 to 1.4.4
  • Keywords regression added

comment:2 Changed 3 years ago by john

  • Status changed from assigned to closed
  • Resolution set to fixed

Pulled in.

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.