open Method

DHTML, HTML, & CSS

 
Click to return to the DHTML, HTML & CSS home page    
open Method     parentElement Method     DHTML Methods    

open Method


Opens a document to collect the output of write or writeln methods.

Syntax

oNewDoc = document.open(sMimeType [, sReplace])

Parameters

sMimeTypeRequired. String that specifies the MIME type. Currently supports "text/html" only.
sReplaceOptional. 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 ]
PlatformVersion
Win16:
Win32:
Mac:
Unix:
WinCE:
Version data is listed when the mouse hovers over a link, or the link has focus.

document

See Also

onbeforeunload


Back to topBack to top

Did you find this topic useful? Suggestions for other topics? write us!Internet Link

© 1999 microsoft corporation. all rights reserved. terms of useInternet Link.