I create an IFRAME dynamically in the following way:
var wrapUpIframe = document.createElement(iframe);
wrapUpIframe.id = 'WrapUpDialog3';
wrapUpIframe.src = 'WrapUpDialog.html';
document.body.appendChild(wrapUpIframe);
after the dynamic creation my document.domain
is being shortened from Servername.dc.com
to only dc.com
,
but when I try to access contentWindow
I got an Access is denied error:
document.getElementById(WrapUpDialog3).contentWindow.SomeFunction();
Note: When I define the IFRAME statically in the HTML it works fine.
I also tried to change my IFRAME document.domain
in the following way:
WrapUpDialog3.document.domain = dc.com;
I checked both document.domain
and my IFRAME domain and they are both identical.
What can I do?
I'm working with IE9.