Access denied. on jquery.form.js in IE

How to solve this problem? Access denied by IE: (jquery.form.js)

=> if (io.contentWindow.document.execCommand) { try { // #214 io.contentWindow.document.execCommand('Stop'); } catch(ignore) {} } 
+4
source share
2 answers

Today I was struck by the same problem.

However, this problem has been documented.

The problem is that the code is broken in IE9. The comments from the link explain the problem:

This is due to IE "friendly error messages". For HTTP responses 4xx and 5xx, IE replaces the contents of IFRAME with its friendly error message and thereby changes the frame domain. When a plugin tries to access the response document, it fails due to policies of the same origin, which leads to the plugin treating the request as aborted

Due to this security restriction, the IE js interpreter blocks a security exception from accessing io.contentWindow.document.

quick fix / hack (moves if call inside try block):

 try { // #214 if (io.contentWindow.document.execCommand) io.contentWindow.document.execCommand('Stop'); } catch (ignore) { } 

I have this fix in production and I have not found any negative side effects in IE8 / IE9

+4
source

Based on the minimal information you provided, it looks like you are trying to use JavaScript in one window to access the window from another source. You cannot do this; it is not permitted by the Same Origin Policy . The only way to "allow" is to do something else instead.

+2
source

Source: https://habr.com/ru/post/1440288/


All Articles