i have setup my ajax request like
$.ajax({
url: 'ajax.html',
datatype: 'html',
success: function(data) {
$(data).appendTo('body');
},
error: function(xhr, status, e) {
alert('An error occured: ' + status);
}
});
when i trigger an error by specifying a non existent url, i find that status is always null. i tried xhr.statusText
, xhr.responseText
, xhr.status
all returns nothing also. how can i get an error message?
when i try alert(e)
i get
[Exception... "Access to restricted URI denied" code: "1012" nsresult: "0x805303f4 (NS_ERROR_DOM_BAD_URI)" location: "http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js Line: 130"]
but i want something more like page not found. why isit giving me access restricted? and why is status, xhr.statusText etc all null?
UPDATE
it works online but not on localhost, maybe its just some configuration thing