大佬教程收集整理的这篇文章主要介绍了jquery – 不使用201状态代码调用回调成功,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
我的代码是:
$.ajax({ url: "/api/skills.json",data: JSON.Stringify(skill),method: "POST",contentType: "application/json",statusCode: { 201: function (data) { console.log("201"); } },success: function (data) { console.log("success"); },error: function (data) { console.log("error"); },complete: function (data) { console.log("complete"); } });
从Firefox控制台导致“网络”:
http/1.1 201 Created Date: Thu,27 Oct 2016 08:29:08 GMT Server: Apache X-Powered-By: PHP/7.0.8 Cache-Control: no-cache LOCATIOn: http://localhost/api/skills/PDAk12ada64d Allow: POST Content-Length: 0 Keep-Alive: timeout=5,max=100 Connection: Keep-Alive Content-Type: application/json
控制台的结果:
"201" "error" "complete"
以上是大佬教程为你收集整理的jquery – 不使用201状态代码调用回调成功全部内容,希望文章能够帮你解决jquery – 不使用201状态代码调用回调成功所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。