I am using jQuery 1.6 and I would like to know and understand how I can access response xhr, status and ex variables in the following code:
$jQuery.ajax({
type: "POST",
url: "<some_url>",
error: function(xhr, status, ex) {
var msg = "";
if (xhr) {
msg = "readyState is " + xhr.readyState + ". ";
}
if (ex) {
msg += ex.name + ' - ' + ex.message;
}
alert("ERROR " + msg); }
success: function(jqXHR, status, ex) {
...
}
});
How can I know the full list of all them “accessible” values like, for example, readyState for the xhr (xhr.readyState), name and message for the ex (ex.name and ex.message)?
Moreover, what xhr and ex variables represent (I think status refers to the HTTP status code)?
I strongly suggest you to have a look at the docs.
Here an example.
jQuery has a very good documentation. The docs should be the first place to look at, for questions like yours. If you encounter problems while implementing jQuery you are welcome to ask at SO.