SCRIPT70: Permission denied IE9
Asked Answered
I

9

21

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.

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.

thanks.

Integrant answered 18/3, 2011 at 12:36 Comment(2)
You need to reproduce it with a non-minified version so you can see the line of code which actually causes it.Kea
i just realized, it does not allow any script file. I could see a quite simple line in a non-minified js file. var imageType = jQuery("#imageType").val(); we open an iframe and try to run javascript inside could this be the reason?Integrant
A
11

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)

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.

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

Amoroso answered 6/5, 2012 at 14:8 Comment(1)
I'm getting this with window.postMessage from an iFrame to parent cross origin domain on IE11. With Edge Browser it works fine. Can someone explain the "host/protocol/port number matches" more in detail please?Stillhunt
L
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/

Lugsail answered 8/9, 2014 at 13:39 Comment(2)
You should add some explaining text to your answer. Also, I don't see how your jsfiddle demonstrates anythingSilly
you need to edit your jquery-*.js and add the try catch within the sizzle function (the function causing the access denied). I don't like playing in the jquery file but it does solve the problemPsychology
W
2

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

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 http and the site had been updated with https so check your URLS.

Wroughtup answered 1/6, 2016 at 16:57 Comment(0)
K
1

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

Kea answered 18/3, 2011 at 13:49 Comment(0)
C
0

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

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

Cameo answered 4/3, 2014 at 11:20 Comment(0)
I
0

Recently I encountered this error. In the application I am working, I'm using TinyMce text editor for our email composer. This creates an iframe which 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!

Inharmonious answered 12/3, 2015 at 5:58 Comment(0)
M
-2

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.

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
Mapping answered 29/5, 2013 at 13:18 Comment(0)
S
-2

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

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

Selena answered 18/2, 2014 at 17:27 Comment(0)
B
-3

Tip from this one page should help: 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)

Bainbridge answered 17/10, 2012 at 10:9 Comment(2)
Uuhhm, do they really expect me to tell this to all IE9 users who visit my public site?Absorbance
This is the worst idea ever. You cannot expect me to tell my 30 million users to change their registry. Are you serious?Aman

© 2022 - 2024 — McMap. All rights reserved.