[英]Could someone explain why my code is giving me the following error in safari?
I have recently been building an overlay system for a display in my lobby. 我最近一直在为我的大厅中的显示器构建覆盖系统。 I am using the embed tag as follows: 我正在使用embed标签,如下所示:
<embed src="flatly.theme/index.html" style="width:237px;height:344px;left:0px;top:0px;z-index:1;position:absolute;">
this is the error I have been getting: 这是我一直得到的错误:
[Error] XMLHttpRequest cannot load http://xml.weather.yahoo.com/forecastrss/CAXX0504.xml. Origin null is not allowed by Access-Control-Allow-Origin. (index.html, line 0)
If someone could explain to me why this is happening and how I can make it run fluently again, it would be great. 如果有人可以向我解释为什么会发生这种情况以及如何使它再次流畅运行,那将是很棒的。
Thanks in advance 提前致谢
Brett 布雷特
.html file you a trying to use in <iframe> not supposed to be there. 您尝试在<iframe>中使用的.html文件不应该存在。
Access-Control-Allow-Origin is part of Cross-origin resource sharing Access-Control-Allow-Origin是跨域资源共享的一部分
is a mechanism that allows restricted resources (eg fonts, JavaScript, etc.) on a web page to be requested from another domain outside the domain from which the resource originated. 是一种机制,允许从资源来源的域之外的另一个域请求网页上的受限资源(例如,字体,JavaScript等)。 1 1
And your domain is not allowed by xml.weather.yahoo.com xml.weather.yahoo.com不允许您的域
I believe this can sometimes happen for local html pages (file:///* ) And can be working as intended on any http server, even on http://localhost 我相信这有时可能会在本地html页面(file:/// *)上发生,并且可以按预期在任何http服务器上运行,甚至在http:// localhost上也可以
it is explained in a lot of similar questions. 许多类似的问题对此都有解释。 JavaScript - XMLHttpRequest, Access-Control-Allow-Origin errors JavaScript-XMLHttpRequest,Access-Control-Allow-Origin错误
在“ index.html”中检测到您的浏览器存在跨域请求,并将其阻止
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.