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

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

问题描述


$ b

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



我看到google帖子提示这与Flash和我们的crossdomain.xml有关。是什么导致了这种情况发生,你如何解决?

解决方案

你是使用JavaScript来沟通帧/ iframe指向不同域?这是JS同源/域安全策略所不允许的。即,如果您有

 < iframe name =foosrc =foo.com/script.js> 
< iframe name =barsrc =bar.com/script.js>

bar.com上的脚本尝试访问 window [foo ] .Location.toString ,你会得到这个(或者类似的)异常。另请注意,如果您拥有来自不同子域的内容,也可以使用相同的来源策略。 在这里你可以找到一个简短的和点的解释它带有例子。


This error just started popping up all over our site.

Permission denied to call method to Location.toString

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?

解决方案

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">

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天全站免登陆