ajax跨域请求Webservice:已阻止跨源请求:CORS 头缺少 'Access-Control-Allow-Origin'

前端之家收集整理的这篇文章主要介绍了ajax跨域请求Webservice:已阻止跨源请求:CORS 头缺少 'Access-Control-Allow-Origin'前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

在Web.Config中加入

@H_502_3@<system.webServer> <httpProtocol> <customHeaders> <add name="Access-Control-Allow-Headers" value="Content-Type"/> <add name="Access-Control-Allow-Methods" value="GET,POST,PUT,DELETE,OPTIONS"/> <add name="Access-Control-Allow-Origin" value="*"/> </customHeaders> </httpProtocol> </system.webServer>

猜你在找的Ajax相关文章