Skip to main content

Bug Tracker

Side navigation

#14493 closed bug (invalid)

Opened October 29, 2013 02:56PM UTC

Closed November 28, 2013 09:18AM UTC

$.ajax() Callbacks

Reported by: simon.hayllar@gmail.com Owned by: simon.hayllar@gmail.com
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";
?>
Attachments (0)
Change History (3)

Changed November 10, 2013 07:25PM UTC by dmethvin comment:1

owner: → simon.hayllar@gmail.com
status: newpending

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?

Changed November 13, 2013 04:57PM UTC by anonymous comment:2

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.

Changed November 28, 2013 09:18AM UTC by trac-o-bot comment:3

resolution: → invalid
status: pendingclosed

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!