Re: XML Events : Should modification of the node containing a script be allowed?

> [Original Message]
> From: David Woolley <david@djwhome.demon.co.uk>
>
>
> > but there are some real advantages to limiting scope to just the one
> > <script> element (plus any other elements that are explicitly included)
>
> Are not event handler attributes (onxxxx) effectively script elements 
> and wouldn't this therefore make these almost unusable?

XHTML2 doesn't use the traditional event handler attributes at present.

Instead of 

<script> somefunction ( ) { code } </script>
...
<span id="span1" onclick="somefunction()">The text</span>

One could  use
<script id="somefunction"> {code} </script>
<listener observer="span1" event="click" handler ="#somefunction" />
...
<span id="span1">The text</span>

> Also, one can assign new attributes to EcmaScript objects, including
> attributes which are methods.  Wouldn't this mean that you would have
> to maintain parallel DOMs so that each scripting environment couldn't
> see the attributes maintained by the others on the DOM elements?

No, just the one DOM and thus only one copy of the document object.
 Interaction between the scripts would be possible via the DOM.  However,
the global object could differ between two script elements. The most
obvious side effect of this would have to be that the window object
could no longer serve as the global object as it does in JavaScript.
This would not cause any problems for ECMAScript however.  This
might cause some adjustment problems for script writers if they've
become use to using shortcuts like:
   status = "Working...";
instead of:
   window.status = "Working...";
However being able to use statements like:
   b = 7;
without having to worry about unintended side effects is a nice benefit.
(Possibly each of the properties of window could be mapped onto
the global object of each script but that seems like a lot of
redundant redundancy.)

W3C has never defined the window object as part of the DOM
and using window.document to access the DOM is merely a
matter of convention. (A convention so ingrained, that having
the window and document objects as properties of the global
objects should be maintained in my opinion.)

Received on Tuesday, 9 March 2004 18:27:13 UTC