简体   繁体   English

有人可以解释为什么我的代码在Safari中给我以下错误吗?

[英]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.

相关问题 有人可以解释为什么我的页脚在页面中间? - Could someone explain why my footer is in the middle of the page? 有人可以帮我在 Safari 上使用引导程序修复我的代码问题吗? - Can someone help me fix my code issue with bootstrap on Safari? 有人可以解释为什么我的代码无法正常工作吗? - Can someone explain why my code isn't working correctly? 有人可以告诉我为什么此代码不起作用吗? - Could someone tell me why this code isn't working? 有人可以为我解释这个示例 PHP 代码吗? - Can someone explain this sample PHP code for me? 有人可以向我解释为什么在脚本文件之前加载CSS文件时网页加载速度更快吗? - Could someone explain to me why a webpage loads faster when you load CSS files before script files? 为什么JSLint使用此代码给我一个“意外的&#39;。&#39;”错误? - Why is JSLint giving me an “Unexpected '.'” error with this code? 有人能告诉我为什么这段代码不叫我function吗? - Could someone tell me why this piece of code doesn't call me that function? 有人可以帮我纠正我的循环吗? - Could someone help me to correct my loop? 我的跟踪JavaScript导致右键单击打开链接-有人可以帮助我发现代码中的错误吗? - My tracking JavaScript is causing a right click to open the link - could someone help me spot the mistake in my code?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM