open Method
Opens a document to collect the output of write or writeln methods.
Syntax
oNewDoc = document.open(sMimeType [, sReplace])
Parameters
sMimeType Required. String that specifies the MIME type. Currently supports "text/html" only. sReplace Optional. String that specifies whether the new document being written is to replace the current document in the History list. Otherwise, by default, the document being created does not replace the current document in the History list.
Return Value
Returns a reference to the new document.
Example
This example uses the open method to replace the current document with a new document and display the HTML markup contained in the variable sMarkup.
var oNewDoc = document.open("text/html", "replace"); var sMarkup = "<HTML><HEAD><TITLE>New Document</TITLE><BODY>Hello, world</BODY></HTML>"; oNewDoc.write(sMarkup); oNewDoc.close();
Applies To
[ Object Name ] Platform Version Win16: Win32: Mac: Unix: WinCE: Version data is listed when the mouse hovers over a link, or the link has focus.
See Also
Did you find this topic useful? Suggestions for other topics? write us!
© 1999 microsoft corporation. all rights reserved. terms of use.