Hi all,
I am using the prototype JavaScript library to read the contents of a text area (which is often the complete mark-up for another HTML page), create a new window and then set the new window content to be that same mark-up, like so:
var htmlContent = $("msHTML").value;
var win = window.open("preview.cfm", "Preview HTML", "left=20,top=20,width=500,height=500,toolbar=0,resizable=1,scrollbars=1");
win.document.write(htmlContent); //TODO - throwing an error in IE 7 - Error Invalid Argument
win.document.close();
This works just fine in Firefox but as mentioned in the comment, it's giving an Illegal Argument exception in IE7.
Can anyone help?
I couldn't find anything in the prototype library that might get around browser differences when setting document content. I know there might be another windowing library built on prototype that might work, but that seems like overkill for this issue I think.
Thanks in advance!