Opened 9 years ago
Closed 9 years ago
#14493 closed bug (invalid)
$.ajax() Callbacks
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | undecided | Milestone: | None |
Component: | unfiled | Version: | 2.0.0 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
On our site we're using push notifications, when a user clicks on a link to download a file it cancels the active push notification. In Firefox this results in the error callback triggering in the $.ajax function, however none of the callbacks are triggered in Chrome.
If you comment out the $.ajax() part and un-comment the other JavaScript within the index.php you can see that in Chrome the ready state does change to 4 and has a status of 0. Firefox does have another readstate change of 2, so I'm unsure if this is a bug with Chrome itself.
index.php
<html> <head> <script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js"></script> <script> /* var ajaxRequest; try{ // Opera 8.0+, Firefox, Safari ajaxRequest = new XMLHttpRequest(); } catch (e){ // Internet Explorer Browsers try{ ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try{ ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e){ // Something went wrong alert("Your browser broke!"); } } } ajaxRequest.onreadystatechange=function() { alert(ajaxRequest.readyState); alert(ajaxRequest.status); } ajaxRequest.open("GET","long_request.php",true); ajaxRequest.send(); */ $.ajax({ url : 'long_request.php', type : 'get', complete : function(){alert('complete')}, success : function(){alert('success')}, error : function(){alert('error')} }); </script> </head> <body> <a href="get_file.php">Get File</a> </body> </html>
long_request.php
<?php sleep(30); ?>
get_file.php
<?php header('Content-type: application/txt'); header('Content-Disposition: attachment; filename="file.txt"'); echo date("l"); echo "\r\n"; ?>
Change History (3)
comment:1 Changed 9 years ago by
Owner: | set to [email protected]… |
---|---|
Status: | new → pending |
comment:2 Changed 9 years ago by
This issue still persist on 2.0.3 and 2.1. The Chrome version I'm on is 30.0.1599.101 m.
With above versions in Firefox, the request is canceled and I get the error alert() followed by the complete one. In Chrome the request is canceled and none of the alerts trigger.
comment:3 Changed 9 years ago by
Resolution: | → invalid |
---|---|
Status: | pending → closed |
Because we get so many tickets, we often need to return them to the initial reporter for more information. If that person does not reply within 14 days, the ticket will automatically be closed, and that has happened in this case. If you still are interested in pursuing this issue, feel free to add a comment with the requested information and we will be happy to reopen the ticket if it is still valid. Thanks!
Does the problem still reproduce on the current 2.0.3, and on http://code.jquery.com/jquery-git2.js which is the future 2.1?