SCRIPT70:IE9允许拒绝

时间:2011-03-18 12:36:47

标签: javascript permissions internet-explorer-9

我在IE-9上收到奇怪的错误“SCRIPT70: Permission denied jquery.js, line 21 character 67”。在谷歌搜索但除了CKEditor上的错误之外找不到任何东西。

它显示的位置只包含以下内容:

P=navigator.userAgent,xa=false,Q=[],M,ca=Object.prototype.toString,da=Object.prototype.hasOwnProperty,ea=Array.prototype.push,R=Array.prototype.slice,V=Array.prototype.indexOf;c.fn=c.prototype={init:function(a,b){var d,f;if(!a)return this;if(a.nodeType){this.context=this[0]=a;this.length=1;return this}if(typeof a==="string")if((d=Oa.exec(a))&&(d[1]||!b))if(d[1]){f=b?b.ownerDocument||b:s;if(a=Sa.exec(a))if(c.isPlainObject(b)){a=[s.createElement(a[1])];

是否有人遇到此错误?

* 其他信息: *我们打开iframe并在此iframe中调用一些javascript函数。

感谢。

9 个答案:

答案 0 :(得分:11)

IE9中的SCRIPT70错误最有可能发生在iframe调用某些javascript时(特别是如果它影响父页面 - 例如父URL的哈希更改)

检查iframe的主机/协议/端口号是否匹配。 IE9对主机名非常严格(在我的情况下直到www部分),而document.domain似乎没有为此提供解决方法。

遇到此问题并在处理多个iframe时修复了此问题,希望这可以帮助其他人解决同样的问题。

答案 1 :(得分:2)

function Sizzle( selector, context, results, seed ) {
  var match, elem, m, nodeType,

  // QSA vars
  i, groups, old, nid, newContext, newSelector;

  // MY EDIT - this try/catch seems to fix IE 'permission denied' errors as described here:
  // http://bugs.jquery.com/ticket/14535

  try{
    document === document; //may cause permission denied
  }
  catch(err){
    document = window.document; //resets document, and no more permission denied errors.
  }

  if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) {
    setDocument( context );
  }

  //...... snip .........//
}

http://jsfiddle.net/xqb4s/

答案 2 :(得分:2)

我遇到了IE9的确切问题,事实上,它也发生在IE11上。

我的问题是我通过http开设了一个网站(即http://mywebsite.com),我的代码中的iframe尝试使用https访问网站的一部分。这导致了错误。我使用https访问网站后,错误就消失了。旧的书签是使用http的原因,并且该网站已使用https进行了更新,因此请检查您的网址。

答案 3 :(得分:1)

如果指向与父网站不同的域,则无法访问任何iframe的内容。

答案 4 :(得分:0)

如果您正在处理脚本中的select元素,那么您的问题就像我的

SCRIPT70: Permission denied when adding options to select element from a recently closed iframe

答案 5 :(得分:0)

最近我遇到了这个错误。在我正在使用的应用程序中,我使用 TinyMce文本编辑器作为我们的电子邮件编辑器。这会创建一个 iframe ,其中包含电子邮件编辑器所需的对象。在看到许多关于上述错误的博客后,我尝试以编程方式删除TinyMce文本编辑器对象,然后触发重定向。它工作了!

答案 6 :(得分:-2)

这一页的提示应该有所帮助:http://forum.jquery.com/topic/strange-behaviour-in-ie9

  

确保HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ Internet Explorer \ MAIN \ FeatureControl \ FEATURE_OBJECT_CACHING \ iexplore.exe未设置为0(应为1或缺少)

答案 7 :(得分:-2)

面对类似的问题(可能不是jquery.js但是相同的错误描述),解决方案与上面有点不同。其实我在regedit中搜索了其他iexplore.exe行。我找到了另外两个并将它改为1然后就可以了。

hkey_local_machine\software\microsoft\internet explorer\main\featurecontrol\feature_protocol_lockdown 
hkey_local_machine\software\microsoft\internet explorer\main\featurecontrol\feature_internet_shell_folders

答案 8 :(得分:-2)

如果您运行的是64位操作系统,请确保此键的值也设置为1:HKEY_LOCAL_MACHINE\SOFTWARE\**Wow6432Node**\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_OBJECT_CACHING\\iexplore.exe

如果没有此密钥,我们在Internet Explorer 11中会出现随机SCRIPT70: Permission denied错误。

相关问题