I want to check if a page returns the status code 401. Is this possible?
Here is my try, but it only returns 0.
$.ajax({ url: \"http://my-ip/tes
Use the error callback.
For example:
jQuery.ajax({'url': '/this_is_not_found', data: {}, error: function(xhr, status) { alert(xhr.status); } });
Will alert 404