![]() |
|
![]() |
||
![]() |
![]() |
|
[WWW-HTML Mailing List Archive Home] [Messages By Thread] [Messages By Date] Re: XML Events : Should modification of the node containing a script be allowed?
From: Jim Ley <jim@jibbering.com>
Date: Thu, 11 Mar 2004 19:30:27 -0000 To: www-html@w3.org Message-ID: <c2qerm$off$1@sea.gmane.org> "Ernest Cline" <ernestcline@mindspring.com> wrote in message news:410-22004329232712781@m...... > <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> An unfortunate mechanism which does more to confuse script/content. The current SVG proposals to extend XML Events at least addresses some of this - but the DOM methods should be preferred, I don't see the motivation for having XML events at all. DOM addEventListener should be preferred. > Interaction between the scripts would be possible via the DOM. By firing mutation events on some special case? > However being able to use statements like: > b = 7; > without having to worry about unintended side effects is a nice benefit. Not really, a closure gives you that trivially, and the inability to share functions across is a much more significant problem. It seems to me that you're concerned with collisions between variables and mutations of script elements, the first of which better script techniques can solve, the 2nd is simply not a problem with how scripts are defined in other XML based languages so I don't see why it should be in XHTML2. Jim.Received on Thursday, 11 March 2004 14:32:09 GMT |
|
||||||||||||||||