EDIT: jQuery'ajax'statusCode method works, but only in jQuery 1.5
I tried using jquery ajax statusCode ', now works with jquery 1.5 , but didn’t get any results ... but this should be the way ...
if my php script does this:
//localhost/dev/false.php header("HTTP/1.0 404 Not Found"); exit();
and my javascript does this:
$.ajax({ url:'http://localhost/dev/false.php', statusCode: { 404: function() { alert('page not found'); } } });
source share