一个解决方案,多个项目跨域问题
解决方法:
1.配置web.config
<!-- 跨域 --> <system.webServer> <httpProtocol> <customHeaders> <add name="Access-Control-Allow-Credentials" value="true" /> <add name="Access-Control-Allow-Headers" value="origin,x-requested-with,content-type" /> <add name="Access-Control-Allow-Methods" value="POST,GET,OPTIONS" /> <add name="Access-Control-Allow-Origin" value="*" /> </customHeaders> </httpProtocol> </system.webServer>
2.百度说用 jsonp,没试过
记录:注意,给了谷歌好像默认不给json的显示,试用IE就能呈现出json的结果下载(360的IE内核无效)