php怎么写能让jq的ajax进入error回调函数

就是我的php执行什么代码,或者输出什么以后,我网页那边用jquery提交的ajax能进入error回调函数,最好是能带信息的那种

HUH函数
浏览 647回答 2
2回答

一只斗牛犬

PHP 代码示例:// 构建&输出 Response Header 头信息$code = 500; $errormessage = 'Internal Server Error'; $status_header = 'HTTP/1.1 ' . $code . ' ' . $errormessage; header($status_header);// 输出Response body$data = array('msg' => 'this is error message');echo json_encode($data);exit;
打开App,查看更多内容
随时随地看视频慕课网APP