T
Thomas
Hy dudes,
I have a strange problem. I dynamically create an IFrame with
JavaScript and then fill in some content. Afterwards I want to switch
to designMode. There the trouble starts. In Mozilla it works perfectly
(even it doesn't stop loading the page, but this doesn't matter), but
the whole IE crashes and shuts down itself without reason. Can you
help? Has someone had the same problem?
I already switched the order for filling the iframe
in IE -> first switch to designMode & then fill
in Mozilla -> first fill designMode & then switch
My code looks something like this (abbreviated):
function transformIFrame(content,element) {
iFrame = document.createElement("iframe");
iFrame.setAttribute("id","editArea");
iFrame.setAttribute("frameborder","0");
iFrame.setAttribute("marginwidth","0px");
iFrame.setAttribute("marginheight","0px");
iFrame.style.border = "0px";
iFrame.style.padding ="0px";
editAreaHeight = element.offsetHeight;
editAreaWidth = element.offsetWidth;
if(moz) {
element.parentNode.replaceChild(iFrame,element);
} else {
element.replaceNode(iFrame);
}
iFrame = document.getElementById("editArea");
iFrame.height = editAreaHeight;
iFrame.width = editAreaWidth;
editArea = iFrame.contentWindow.document;
styleCSS = "<style>BODY { font-size: 9pt; }</style>";
if(!moz) {
editArea.write("<html><head><title></title>" + styleCSS +
"</head><body>" + content + "</body></html>");
editArea.designMode = "On";
} else {
editArea.write("<html><head><title></title>" + styleCSS +
"</head><body>" + content + "</body></html>");
editArea.designMode = "On";
}
iFrame.contentWindow.focus();
}
Thx for your help
Bye, Thomas
--
"It's a Texan thing - y'all wouldn't understand!" - read in San
Antonio,
July 2003
------------------------------------------------------------------------
I have a strange problem. I dynamically create an IFrame with
JavaScript and then fill in some content. Afterwards I want to switch
to designMode. There the trouble starts. In Mozilla it works perfectly
(even it doesn't stop loading the page, but this doesn't matter), but
the whole IE crashes and shuts down itself without reason. Can you
help? Has someone had the same problem?
I already switched the order for filling the iframe
in IE -> first switch to designMode & then fill
in Mozilla -> first fill designMode & then switch
My code looks something like this (abbreviated):
function transformIFrame(content,element) {
iFrame = document.createElement("iframe");
iFrame.setAttribute("id","editArea");
iFrame.setAttribute("frameborder","0");
iFrame.setAttribute("marginwidth","0px");
iFrame.setAttribute("marginheight","0px");
iFrame.style.border = "0px";
iFrame.style.padding ="0px";
editAreaHeight = element.offsetHeight;
editAreaWidth = element.offsetWidth;
if(moz) {
element.parentNode.replaceChild(iFrame,element);
} else {
element.replaceNode(iFrame);
}
iFrame = document.getElementById("editArea");
iFrame.height = editAreaHeight;
iFrame.width = editAreaWidth;
editArea = iFrame.contentWindow.document;
styleCSS = "<style>BODY { font-size: 9pt; }</style>";
if(!moz) {
editArea.write("<html><head><title></title>" + styleCSS +
"</head><body>" + content + "</body></html>");
editArea.designMode = "On";
} else {
editArea.write("<html><head><title></title>" + styleCSS +
"</head><body>" + content + "</body></html>");
editArea.designMode = "On";
}
iFrame.contentWindow.focus();
}
Thx for your help
Bye, Thomas
--
"It's a Texan thing - y'all wouldn't understand!" - read in San
Antonio,
July 2003
------------------------------------------------------------------------