I have a script loaded into an iframe trying to access an element which is just above that iFrame using $(frameElement).closest('div')
. This works in Chrome and Firefox perfectly fine. But on IE11, it says Permission Denied
. It is able to access the iFrame element, but is not allowing any kind of operation on it.
There are other iFrames(the same script to access the element is present in all these iFrames too) loaded into the same page. In all the other iFrames this works just fine even in IE11, but this one iFrame it doesn't work. The only difference between this iFrame and others is that this iFrame has got child iFrames.
PS: The iFrame(the one which I am trying to access via $(frameElement)) and the parent are in the same domain and there are 2 child iFrames one has src as blank and the other one is from different domain. Also, the script to access the iFrame is loaded into the parent Iframe. This is how the structure looks like, the webpage domain is also a.com, and I am trying to access the parent Iframe here. Here, $(frameElement) @ script-to-access-iframe returns the Iframe element, using closest() on that says 'Permission Denied' in IE11.
<body>
<div>
<iframe id="parent" src="wwww.a.com">
#document
<html>
<body>
<script src="www.a.com/scripts/script-to-access-iframe">
<div>
<iframe id="child1" src="about:blank">
<iframe id="child2" src="www.b.com">
</div>
</body>
</html>
</div>
</body>