我已经更改了我的MVC应用程序上的Web配置以允许CORS。
我的配置文件中有以下代码:
<system.webServer>
<httpProtocol>
<customHeaders>
<add name="Access-Control-Allow-Origin" value="*" />
</customHeaders>
</httpProtocol>
</system.webServer>
但我仍然在chrome中遇到以下错误:
XMLHttpRequest无法加载https://erikberg.com/nba/standings.json。请求的资源上不存在“Access-Control-Allow-Origin”标头。因此,不允许原点“http://demo.liamht.com”访问。
我环顾四周,并且已经遵循了一些建议,没有任何建议。 IIS设置正确,工作正常。