Re: If...else statement

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Dave Anderson wrote:
Richard Cornford wrote:
They are fully W3C standard at current levels and have
the considerable advantage of being back-compatible with
everything that ever understood what a form was.

I searched, but could not find the window object in DOM
Level 3. Not exactly "everything that ever understood what
a form was", or was I just missing something?

I am not sure where the window object not being in DOM Level 3 comes
into anything I said. What I mend by "everything that understood what a
form was", was that in every browser that ever exposed form controls to
scripting accessing those controls through the - forms - collection of
the document and the - elements - collection of the form elements has
been possible, and where those property accessor did not work the form
controls where not exposed in the browser object model at all so no
alternative would have worked.

On the other hand I suspect you are making a valid point, but perhaps
one better expressed with an alternative example. Specifically; no W3C
DOM standard has ever specified that the ECMAScript global object (or
window object, as they are the same object in a browser object model)
should have a property named "document" that referred to the Document
object at the root of the DOM.

They had an opportunity to do so with the specification for the -
AbstractView - and - DocumentView - interfaces (W3C Document Object
Model Views; Level 2) if they had included a requirement in the
ECMAScript bindings that it should be the ECMAScript global object that
implements AbstractView, but the opportunity was missed.

So while:-

document.forms['formName'].elements['controlName']

- might be as W3C standard as:-

document.getElementById('contorlId')

- the use of the - document - identifier at the beginning or each is not
really W3C standard at all (at any level). Of course, if you don't
assume that the ECMAScript global object has a property called
'document' that refers to the root object of the DOM you are not going
to get very far at scripting web browsers at all. It makes a nonsense of
any appeal that web browsers should be exclusively scripted in
accordance with W3C standards as that is actually a practical
impossibility.

Richard.


.



Relevant Pages

  • Re: Dynamic select lists using optgroups again - without frameworks
    ... convertible to boolean `true' does not follow necessarily that the property ... implement the EventTarget interface of W3C DOM Level 2 Events. ... Window object instead. ... by numerous frameworks and scripts, ...
    (comp.lang.javascript)
  • Re: Dynamic select lists using optgroups again - without frameworks
    ... convertible to boolean `true' does not follow necessarily that the property ... also supporting several event listeners ... Window object instead. ... You will observe that you also don't need any DOM branching for this. ...
    (comp.lang.javascript)
  • Re: Accesing an IFrame from an internal element
    ... More likely because he knows how the DOM works. ... nor the element has a reference to a window object. ... That's a property on the DOM element of the iframe in the parent document, ...
    (comp.lang.javascript)
  • Re: RegExp for hyphen to camelCase?
    ... You could but the global object has never been defined as an instance of the AbstractView interface. ... I would use the slightly longer, ... And the current WHAT WG drafts also try to ensure that the current praxis that browsers implement document.defaultView as the window object becomes standardized: ... in the DOM but to check for the result too. ...
    (comp.lang.javascript)