I use the jQuery Ajax request the list:
$.get('http://localhost:8000/amodel/list2/', function(data, status){
console.log(status, data); // if fails, there do not console out anything.
});
there is no status code, how to judge the request is success or fail?.
How to optimize the jQuery Ajax http request?
My requirement:
- if fail it should execute the fail handler function.
- if there is a status code, that's better.