How can I get Response code in backbone js when i fetch the result using fetch() method of collection? I know it executes error callback function when the response code is like 4xx and success callback method when the Response code is like 2xx.
var x = user.fetch({
error: function(model, xhr, options){
alert('Error on fetch')
console.log(xhr.responseText);
},
success: function(model, response, options) {
alert(user.toJSON());
}
Here I want to get Response code, No matter whether It is an error callback or success callback.
Thanks in Advance.