Jquery访问Webservice Chrome浏览器报( XMLHttpRequest cannot load "XXX". No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin "XXX" is therefore not allowed access. )异常解决方案,Webservice增加system.webserver配置节web.config 配置如下:<configuration><system.webServer><httpProtocol><customHeaders><add name="Access-Control-Allow-Origin" value="*" /><add name="Access-Control-Allow-Headers" value="Content-Type" /></customHeaders></httpProtocol></system.webServer></configuration>
Jquery访问Webservice Chrome异常
最新推荐文章于 2021-06-11 18:44:13 发布
本文介绍了解决JQuery跨域访问Webservice时出现的'No Access-Control-Allow-Origin'错误的方法。通过在web.config文件中添加system.webserver配置节来允许跨域请求。
3013

被折叠的 条评论
为什么被折叠?



