Skip to end of metadata
Go to start of metadata

This error was happening in a web page where we got info from a page using docuement.getElementById("tagId").innerHtml and wrote it to a new window using document.write("content") to make a Printer Friendly View of the first window.

IE 6 and IE 7 froze up and eventually crashed when I did this:

window.document.write("Some text");
window.document.write("More text");
window.document.write("Much more text");
window.document.write("A little more text");

To solve this I first use a variable to concatenate all the content we want to print and then print the variable's content:

var content = "Some text";
content += "More text";
content += "Much more text";
content += "A little more text";
window.document.write(content); //Prints all at once

I don't know what is the root cause of this but probably IE had problem either calling document.write many times consecutively or writing literal text.

I think it's an IE bug that hopefully they will solve it in future IE versions.

Labels:
None
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.