ajax获取后端序列化返回状态码等参数


 1 <script>
 2     $.ajax({
 3         type: "POST",
 4         url: url,
 5         success: function (response,status,xhr) {
 6             //服务器返回的信息,status和xhr为内置,response为后台返回数据
 7             console.log(response);    
 8             //状态码
 9             console.log(status);    
10             //状态码
11             console.log(xhr.status);    
12             //响应头部
13             console.log(xhr.getAllResponseHeaders()); 
14         },
15         error: function () {
16             console.log("请求失败");
17         }
18     });
19 </script>

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM