I want to write script and iframe elements in the opened window, which works fine in Firefox and Chrome, but not in IE.
My code is below:
var mywindow = window.open(url,'child',params);
mywindow.onload = writeToWindow;
function writeToWindow(){
var myScriptEle = document.createElement('script');
myScriptEle.type = "text/javascript";
myScriptEle.text = " some script";
var myIframe = document.createElement("IFRAME");
myIframe.id = "childwindow";
myIframe.name = "childwindowname";
myIframe.src = MyframeUrl;
if(mywindow){
mywindow.document.getElementsByTagName('body')[0].appendChild(myScriptEle);
mywindow.document.body.appendChild(myIframe);
}
}
I’m getting “No such interface supported” errors
Thanks in advance, please let me know if there’s any work around for IE
1 Answer