Access-Control-Allow-Origin'标头存在于请求的资源上
CORS No 'Access-Control-Allow-Origin' header is present on the requested resource
我得到以下错误:
XMLHttpRequest cannot load http://localhost:62574/ServiceClass.asmx?op=loadMarkersViaWebService. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:15540' is therefore not allowed access.
所以我在Web中添加了以下内容。
<system.webServer>
<validation validateIntegratedModeConfiguration="false"/>
<modules runAllManagedModulesForAllRequests="true"/>
<httpProtocol>
<customHeaders>
<add name="Access-Control-Allow-Origin" value="http://localhost:15540/"/>
</customHeaders>
</httpProtocol>
尝试使用这个…
<httpProtocol>
<customHeaders>
<add name="Access-Control-Allow-Origin" value="*" />
<add name="Access-Control-Allow-Headers" value="Content-Type, Accept" />
</customHeaders>
</httpProtocol>
相关文章:
- 否'访问控制允许来源'标头存在于IISNOde中请求的资源(AngularJS+NodeJs)上
- "资源不足错误“;当从Chrome控制台重复发出ajax请求时
- ajax请求返回me“;错误404”;即使资源存在
- XMLHttpRequest无法加载.否'访问控制允许来源'标头存在于请求的资源上
- 将servlet请求从javascript发送到java给出了“;请求的资源不可用”;
- 否'访问控制允许来源'请求的资源上存在标头.-Pinterest oauth实现
- 否'访问控制允许来源'标头存在于请求的资源上.起源'http://localhost:8100&
- 否'访问控制允许来源'标头存在于请求的资源上.原点''因此不允许访问
- 否'访问控制允许来源'当跨域设置为true时,请求的资源错误中存在标头
- AngularJS:没有'访问控制允许来源'标头存在于请求的资源上
- 亚马逊s3 Javascript-否'访问控制允许来源'标头存在于请求的资源上
- 是否有任何事件在浏览器请求另一个资源(如图像)之前触发
- 在AngularJS$资源模块上请求之前获取URL
- Angular$http$资源等价于PDF GET请求
- Azure Blob 存储 请求的资源错误中不存在访问控制允许源标头
- Socket.io 请求的资源上不存在“访问控制允许源”标头.因此,不允许访问源“http://localhost”
- Windows上的CouchDB说请求的资源上不存在“Access-Control-Allow-Origin”标头
- 跨源资源错误:请求的资源上不存在“访问控制允许源”标头
- 区分对$http的应用程序调用和 Angular 对拦截器中静态资源的请求
- 什么会导致Firefox在执行外部脚本后多次请求资源