Ticket #7422 (closed bug: fixed)
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
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

pull request