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 array - I'd like to keep it as clean as possible. Can someone point me in the right direction?
Thanks,
James
If you want to trigger the AJAX error handler, just pass back something other than a 200! Try this:
<?php
header("HTTP/1.0 404 Not Found");
exit();
?>
Just remember to do two things:
This should be the clean solution you are going for.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With