就是我的php执行什么代码,或者输出什么以后,我网页那边用jquery提交的ajax能进入error回调函数,最好是能带信息的那种
2 回答
一只斗牛犬
TA贡献1784条经验 获得超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;- 2 回答
- 0 关注
- 689 浏览
添加回答
举报
0/150
提交
取消
