I read somewhere that HTML5 will not allow document.write() statements.
The following script does use the document.write() statement and it seems to work to create a new window
Timestamp: 12/9/2012 11:34:22 PM
Warning: XUL box for _moz_generated_content_after element contained an inline #text child, forcing all its children to be wrapped in a block.
Source File: chrome://browser/content/browser.xul
What is the appropriate statement to replace the document.write() to avoid the error reports?
[code]
<!doctype html5>
<html>
<head>
<title>JS created window</title>
<script type=”text/javascript”>
function newHTML() {
var HTMLstring='<HTML>n’;
HTMLstring+='<HEAD>n’;
HTMLstring+='<TITLE>New Document</TITLE>n’;
HTMLstring+='</HEAD>n’;
HTMLstring+='<BODY>n’;
HTMLstring+='<P>Hello</P>n’;
HTMLstring+='</BODY>n’;
HTMLstring+='</HTML>’;
var newwindow=window.open(“”, “Window3”, “width=320,height=210,scrollbars=yes”);
[COLOR=”#FF0000″] newwindow.document.write(HTMLstring); // What is replacement statement for document.write() ???
[/COLOR]
newwindow.document.close();
}
</script>
</head>
<body>
<input type=”button” value=”New Window” onclick=”newHTML();”>
</body>
</html>