I want to be able to get a PHP script called via AJAX to return with an error code that the jQuery AJAX handler error: will handle. I don\'t want to use a JSON
EDIT: jQuery'ajax'statusCode' method works, but only in jQuery 1.5
I have tried jquery's ajax's 'statusCode' method, works now, with jquery 1.5 but did not get any results... but it should be the way to go...
if my php script does this:
//localhost/dev/false.php
header("HTTP/1.0 404 Not Found");
exit();
and my javascript does that:
$.ajax({
url:'http://localhost/dev/false.php',
statusCode: {
404: function() {
alert('page not found');
}
}
});