扫码关注官方订阅号
欢迎选择我的课程,让我们一起见证您的进步~~
js: var str = '<p style="color:red;">你好</p>'; $.ajax({ url:'./yoururl', data:{'str':str}, type:'post', dataType:'json', beforeSend:function(){ // }, success:function(res){ if(res.status == 0){ //成功 }else{ alert(res.message); } } }) php: $str = isset($_POST['str'])?trim($_POST['str'])?:''; if($str){ echo json_encode(array('status'=>0,'message'=>'ok')); }else{ echo json_encode(array('status'=>-1,'message'=>'接收失败')); } die;
微信扫码关注PHP中文网服务号
QQ扫码加入技术交流群
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
PHP学习
技术支持
返回顶部
欢迎选择我的课程,让我们一起见证您的进步~~