Created
November 21, 2018 05:17
-
-
Save rajvanshipradeep15/61d56352efa10598d0ce2af0ab4e96db to your computer and use it in GitHub Desktop.
how you get JSON data on error
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Here's an example of how you get JSON data on error: | |
$.ajax({ | |
url: '/path/to/script.php', | |
data: {'my':'data'}, | |
type: 'POST' | |
}).fail(function($xhr) { | |
var data = $xhr.responseJSON; | |
console.log(data); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment