Sunday 15 September 2013

What defines the availability of the DOM `document` property in the javascript global object? -


I am new to JavaScript and trying to understand it that defines what kind of EcmaScript W3C DOM standard and JavaScript Interoperate. In particular, as I understand it I:

ECMAscript provides standard defines the existence of the global object, which parseInt (string) functions such as and clear Form allows the presence of other underlying objects arriving through it, but their definitions are left to implementation.

W3C DOM defines a set of standard objects and interfaces that correspond to the structure of an HTML document. One of these is the document object (uppercase D), which has methods like getElementById . Although this specification, as far as I understand it, does not define how an example of such an object representing the present document in the browser can be obtained.

In fact, what I'm after - when this place is clearly stated that execute JavaScript in the web page, I document.getElementById ( "SomeId") (Notice lowercase D), and that the document property represents DOM in which the JavaScript is executed?

Is this an especially implementation-specific extension? It should not be standardized somewhere? The closest I can get is Gecko DOM document that document and document Equivalent appears I thought JavaScript was the case sensitive? Or am I really getting anal about the interpretation of these things?


Edit:

After commented Jason HTML5 standard traveling through the work of the draft, I am that I see / is

6.5.3.3 Creating a script

... The user agent must run the following steps:

4 . Set the script's global object, script browsing context, script URL character encoding and script of the original URL

6.5.3.1 State which global objects

< P> "This is usually a window object. In Javascript, it corresponds to a global object."

Next, 6.1 browsing context states

"The main view through which a user interacts with a user agent primarily, the default view The AbstraSave object, which represents this view, must also implement the window interface, and it is referred to as the document's window object. Activate WindowProxy object The implementation of the document property as the object of the default view window Stavejh. "

Since Abstrov interface Dom 2, it seems that it defines the existence of JavaScript global document properties.

Despite this I have been steady for a decade, Nominated in the form of "DOM level 0" And it has never been standardized.

, and it will be standardized in HTML5 (an upcoming W3C standard).

For case-sensitivity: document is the name of an interface. This is a type of document document document is correct.

HTMLDocument is another interface. An example of the document HTMLDocument is also true.


No comments:

Post a Comment