Is there a way to get PHP to return an AJAX error code if the PHP script fails somewhere?
I was following a tutorial and typed this in to my PHP:
$return['error'] = true;
$return['msg'] = "Could not connect to DB";
And all was well, until I realised it was JSON data. Is there a way to return errors using standard $_POST and returned HTML data (as in, trigger jQuery's AJAX error:
event?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…