METHOD:  Document::open[mimeType[, replace]])

This method is used to open a stream to collect the output from any write or writeln methods. The first of the optional parameters is mimeType which determines the type of document you are writing to; if this parameter is not used, the default value is "text/html". The second parameter is replace, also optional, which causes the history entry for the new document to inherit the history entry from the document from which it was opened.

The following code demonstrates this method and displays the output stream in a new window.

function newWindowTest() {
  var message1 = "Hello, world!"
  var message2 = "This is a test.""text/html", "replace")

Output: (to new window)
"Hello, world! This is a test."

Copyright 1999-2001 by Infinite Software Solutions, Inc. All rights reserved.
Trademark Information