asp.net.ph

Skip Navigation Links

open Method

DHTML Methods


Open a document stream for writing.

Syntax

document.open ( sMimeType [ ,  sReplace ] ) 
Parameters

sMimeType Required. String that indicates the MIME type. Currently supports "text/html" only.
sReplace Optional. String ( "replace" ) indicating whether you want the new document you are writing to replace the current document in the History list. Otherwise, by default, the document you are creating will not replace the current document in the History list.

Return Value

No return value.

Remarks

This method allows a user to add to or replace the structure model of a document using strings of unparsed HTML. The method opens a document to collect the output of the document write or writeln methods.

If a document exists in the target, this method clears it.

At the time of writing, alternate methods for providing similar functionality for both HTML and XML documents were being considered. This method may be deprecated at some point in the future in favor of a more general-purpose mechanism.

Example

The following example replaces the document with the new document.

document.open ( "text/html", "replace" ) 
Applies To

document

See Also

onbeforeunload



© 2025 Reynald Nuñez and asp.net.ph. All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note