I am really new to ajax and jquery, so please bear with me. I am currently building a small application that will do the basic task of telling you a website's status code, and doing something based on the code that is returned. I found this code online, and it returns "Page not found" if the http status code is 404.
$(function() {
var url = "http://www.google.com";
$.ajax(url,
{
statusCode: {
404: function() {
alert('page not found');
}
}
});
});
But, instead of checking for a 404 status code, how can I save the raw status code value to a variable?
Thanks!