Javascript SCRIPT70:权限被拒绝 IE9

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/5352057/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-23 16:48:09  来源:igfitidea点击:

SCRIPT70: Permission denied IE9

javascriptpermissionsinternet-explorer-9

提问by mehmet6parmak

I am getting the strange error "SCRIPT70: Permission denied jquery.js, line 21 character 67" on IE-9. Searched on google but could not find anything except a bug on CKEditor.

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

Position it showed just contains following:

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

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])];

anyone run into this error?

有人遇到这个错误吗?

*Additional Info:*We open an iframe and call some javascript functions inside this iframe.

*附加信息:*我们打开一个 iframe 并在这个 iframe 中调用一些 javascript 函数。

thanks.

谢谢。

采纳答案by Timothy

The SCRIPT70 error in IE9 occurs most likely when your iframe is calling some javascript (especially if it affects the parent page - e.g. hash change of parent url)

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

Check that your iframe's host/protocol/port number matches. IE9 is exceptionally strict about the host name(down to the www portion in my case) and document.domain did not seem to provide a workaround for that.

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

Encountered this issue and fixed it while dealing with multiple iframes, hope this helps others with the same issue.

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

回答by kamau wairegi

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/

http://jsfiddle.net/xqb4s/

回答by Flea

I was having this exact problem with IE9 and in fact, it happens with IE11 as well.

我在 IE9 上遇到了这个确切的问题,事实上,IE11 也会发生这种情况。

My problem was I was opening a website via http(i.e. http://mywebsite.com) and an iframe within my code was trying to access a portion of the website using https. This was causing the error. Once I accessed the website using https, the error went away. A old bookmark was the cause of it using httpand the site had been updated with httpsso check your URLS.

我的问题是我正在通过http(即 http://mywebsite.com)打开一个网站,而我的代码中的一个 iframe 试图使用https. 这导致了错误。一旦我使用 访问了网站https,错误就消失了。旧书签是它使用的原因,http并且该站点已更新,https因此请检查您的 URL。

回答by ThiefMaster

You cannot access any of your iframe's contents if it points to a different domain than the parent site.

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

回答by Marc De Joya

Recently I encountered this error. In the application I am working, I'm using TinyMce text editorfor our email composer. This creates an iframewhich contains the objects I need for an email composer. After seeing many blogs about the said error, I tried to programmatically remove the TinyMce text editor object then triggered the redirection. And it WORKED!

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

回答by Lucas Ayala

If you are dealing with select element in your script maybe your problem is like mine

如果您正在处理脚本中的 select 元素,那么您的问题可能和我的一样

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

SCRIPT70:添加选项以从最近关闭的 iframe 中选择元素时权限被拒绝

回答by makriria

Facing a similar issue (maybe not with jquery.js but the same error description) the solution was a bit different from above. Actually I have searched for other iexplore.exe lines in regedit. I have found other two and changed it to 1 and it worked then.

面对类似的问题(可能不是 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

回答by AgileArchitect

If you run a 64-bit OS, make sure the value of this key is also set to 1: HKEY_LOCAL_MACHINE\SOFTWARE\**Wow6432Node**\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_OBJECT_CACHING\\iexplore.exe

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

Without this key we had random SCRIPT70: Permission deniederrors in Internet Explorer 11.

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

回答by meloniq

Tip from this one page should help: http://forum.jquery.com/topic/strange-behaviour-in-ie9

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

Make sure that HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\MAIN\FeatureControl\FEATURE_OBJECT_CACHING\iexplore.exe is not set to 0 (it should be 1 or missing)

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