Availability
JavaScript 1.0
Synopsis
document.open( )document.open(mimetype)
Arguments
mimetype
An optional string argument that specifies the type of data to be
written to and displayed in document. The
value of this argument should be one of the standard MIME types that
the browser understands ("text/html",
"text/plain", "image/gif",
"image/jpeg", and "image/x-bitmap" for
Netscape) or some other MIME type that can be handled by an installed
plugin. If this argument is omitted, it is taken to be
"text/html". This argument is ignored by IE 3, which
always assumes a document of type "text/html". This
argument is also not supported in the standard W3C DOM version of
this method. See the HTMLDocument.open( ) entry in the
DOM reference section.
Description
The document.open( )
method opens a stream to document so
subsequent document.write(
) calls can append data to the document. The optional
mimetype argument specifies the type of
data to be written and tells the browser how to interpret that data.
If any existing document is displayed when the open(
) method is called, it is automatically cleared by the call
to open( ) or by the first call to write(
) or writeln( ). After opening a
document with open( ) and writing data to it with
write( ), you should complete the document by
calling close( ).
Usage
You usually call Document.open( ) with no argument
to open an HTML document. Occasionally, a "text/plain"
document is useful, for example, for a pop-up window of debugging
messages.
See Also
Document.close( ), Document.write( ); HTMLDocument.open( ) in the DOM
reference section
•
Table of Contents
•
Index
•
Reviews
•
Examples
•
Reader Reviews
•
Errata
JavaScript: The Definitive Guide, 4th Edition
By
David Flanagan
Publisher
: O'Reilly
Pub Date
: November 2001
ISBN
: 0-596-00048-0
Pages
: 936
Slots
: 1
This fourth edition of the definitive reference to
JavaScript, a scripting language that can be embedded
directly in web pages, covers the latest version of the
language, JavaScript 1.5, as supported by Netscape 6 and
Internet Explorer 6. The book also provides complete
coverage of the W3C DOM standard (Level 1 and Level 2),
while retaining material on the legacy Level 0 DOM for
backward compatibility.