W3C home > Mailing lists > Public > www-dom@w3.org > July to September 2003

RE: What is the status of window object and such?

From: Zeljko VELAJA <zvelaja@visualfriendly.com>
Date: Mon, 7 Jul 2003 10:52:13 +0200
To: <www-dom@w3.org>
Message-ID: <000001c34465$0fb1c4c0$3500000a@visual.com>

I think it's normal that the DOM does not state anything about what the
global object in Javascript is : the EcmaScript concept of a global objet is
absolutely not related to the DOM specification, but only to the
specification of Javascript.

Now EcmaScript's specification does not state in any way how to access
explicitly the global object (due to its very globality) : but every
variable which is not the property of any other object is implicitly a
property of the global object. This is the reason why the "window" variable,
which is a reference to the global object itself, is also a property of the
global object.

Concerning the open() method :
	a) window.open() is a function of the global object, so you can inplicitly
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.


-----Message d'origine-----
De : www-dom-request@w3.org [mailto:www-dom-request@w3.org]De la part de
Marek Kielar
Envoyé : dimanche 6 juillet 2003 22:16
À : www-dom@w3.org
Objet : What is the status of window object and such?



I tried to get information about the global object for JavaScript. There is
no information about it in neither JavaScript Core/Reference nor HTML
Specification, so I went through the ECMAScript specification once again and
found out that in a chapter about global object it states that 'the HTML
document object model states that the window property of the global object
is the global object itself'. However, the DOM doesn't state anything like
that. And reading the discussion on this topic in the DOM mailing list a
question came up. How can I refer to the global object in the HTML? What is
its name? Is it window or document or maybe even something else? Does
document.open means the same as window.open? Because I am afraid that when
using, for instance, window.open it is possible that a browser (not IE and
not Netscape) won't support it and the whole script wouldn't run as it was
intended!!!
Received on Monday, 7 July 2003 04:52:39 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 22 June 2012 06:13:57 GMT