Skip to content

Instantly share code, notes, and snippets.

@johnhunter
Created February 21, 2011 17:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save johnhunter/837428 to your computer and use it in GitHub Desktop.
Save johnhunter/837428 to your computer and use it in GitHub Desktop.
Test case for a possible bug with JQuery 1.5
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>ajax-error</title>
</head>
<body>
<pre id="output"></pre>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.js"></script>
<script>
var out = $('#output');
$.ajax({
type: "GET",
url: 'response.html',
success: function () {
console.log('success ', arguments);
},
error: function () {
console.log('error ', arguments);
},
complete: function (xhr, status) {
if (status === 'error' || !xhr.responseText) {
}
else {
out.append(xhr.responseText);
}
console.log('complete ', arguments);
}
});
</script>
</body>
</html>
<p>Success</p>
@johnhunter
Copy link
Author

Confirmed fixed in JQuery 1.5.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment