这个javascript错误是什么意思?权限被拒绝调用 Location.toString 方法 [英] What does this javascript error mean? Permission denied to call method to Location.toString

查看:14
本文介绍了这个javascript错误是什么意思?权限被拒绝调用 Location.toString 方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这个错误刚刚开始在我们的网站上出现.

This error just started popping up all over our site.

调用 Location.toString 方法的权限被拒绝

我看到谷歌帖子表明这与 flash 和我们的 crossdomain.xml 相关.发生这种情况的原因是什么?您如何解决?

I'm seeing google posts that suggest that this is related to flash and our crossdomain.xml. What caused this to occur and how do you fix?

推荐答案

您是否使用 javascript 在指向不同域的框架/iframe 之间进行通信?这是 JS同源/域"安全策略所不允许的.即,如果你有

Are you using javascript to communicate between frames/iframes which point to different domains? This is not permitted by the JS "same origin/domain" security policy. Ie, if you have

<iframe name="foo" src="foo.com/script.js">
<iframe name="bar" src="bar.com/script.js">

并且 bar.com 上的脚本尝试访问 window["foo"].Location.toString,您将获得此(或类似)异常.另请注意,如果您拥有来自不同子域的内容,则同源策略也可以启动.此处您可以找到对用例子来说明.

And the script on bar.com tries to access window["foo"].Location.toString, you will get this (or similar) exceptions. Please also note that the same origin policy can also kick in if you have content from different subdomains. Here you can find a short and to the point explanation of it with examples.

这篇关于这个javascript错误是什么意思?权限被拒绝调用 Location.toString 方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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