Skip to content

Commit 5055ddf

Browse files
tentonaxescottgonzalez
authored andcommitted
Ajax Methods: Improve error callback example for $.ajax()
Closes jquerygh-372
1 parent 97333d7 commit 5055ddf

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

page/ajax/jquery-ajax-methods.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,11 @@ $.ajax({
5252
5353
// code to run if the request fails; the raw request and
5454
// status codes are passed to the function
55-
error: function( xhr, status ) {
55+
error: function( xhr, status, errorThrown ) {
5656
alert( "Sorry, there was a problem!" );
57+
console.log( "Error: " + errorThrown );
58+
console.log( "Status: " + status );
59+
console.dir( xhr );
5760
},
5861
5962
// code to run regardless of success or failure

0 commit comments

Comments
 (0)