Xmlhttprequest无法加载... [英] Xmlhttprequest cannot load ...

查看:95
本文介绍了Xmlhttprequest无法加载...的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Chrome和Firefox的调试出错(适用于IE 11)

Got error on debugging for Chrome and Firefox (good for IE 11)

HMLHttpRequest cannot load http://.../MapServer/legend?f=json. The 'Access-Control-Allow-Origin' header has a value 'http://localhost:12345' that is not equal to the supplied origin.  Origin 'http://localhost:54321' is therefore not allowed access



如何解决这个问题?谢谢,如果你能提供你的建议。



我尝试过:



HMLHttpRequest无法加载...原因'http:// localhost:54321'因此不允许访问


How can this problem be solved? Thanks if you can provide your advisory.

What I have tried:

HMLHttpRequest cannot load ... Origin 'http://localhost:54321' is therefore not allowed access

推荐答案

您需要了解错误告诉您的内容。您有代码尝试访问其他域中的代码,并且您没有在FireFox和Chrome中禁用该安全功能。我建议你把所有代码放在同一个域中。
You need to understand what the error is telling you. You have code trying to access code in a different domain and you do not have that security feature disabled in FireFox and Chrome. I suggest you put all your code in the same domain.


这篇关于Xmlhttprequest无法加载...的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆