JavaScript

Concerning the open() method

a) window.open() is a function of the global object, so you can implicitly call open() without the window prefix (in fact you could also write window.window.window.open(), since window points to itself). The effect of the open() method of the global object is to create a new navigator window and return a reference to it.

b) document.open() is a function of the document object (which is not the global object) : this method opens a new HTML stream into the current document (there are as many document objects as frames and windows). After document.open() is called you can invoke the document.write() and document.writeln() and finally document.close(), which closes the stream.

W3C Mail Lists; from: "Zeljko VELAJA" zvelaja@visualfriendly.com to: www-dom@w3.org; date: Mon, 7 Jul 2003


See also: SELFHTML - window.open() and SELFHTML - document.open()