I have following snippet of code
$.ajax({
method : "GET",
url : 'http://projectstorehouse.com/travelnews/index.html',
data : "",
success : function(){
alert("Hello");
},
error : function(jqXHR, status, error){
if (jqXHR.status === 0) {
alert('Not connected.\nPlease verify your network connection.');
} else if (jqXHR.status == 404) {
alert ('The requested page not found. [404]');
} else if (jqXHR.status == 500) {
alert ('Internal Server Error [500].');
} else if (exception === 'parsererror') {
alert ('Requested JSON parse failed.');
} else if (exception === 'timeout') {
alert ('Time out error.');
} else if (exception === 'abort') {
alert ('Ajax request aborted.');
} else {
alert ('Uncaught Error.\n' + jqXHR.responseText);
}
}
});
and could not figure out problem associated with it; the message displayed with this is jqXHR.status==0. Url is reachable http://projectstorehouse.com/travelnews/index.html
Can anybody tell me where I am wrong;