Re: Handling of script attributes (was Re: HTML 4.0 draft available)

On Wed, 9 Jul 1997, Scott Matthewman wrote:

> I do think, though, that the insertion of script events into tags
> should be discouraged more firmly, to be replaced by binding from
> a script in the <HEAD> element. Individual event attributes in
> tags should be deprecated, to be replaced by a SCRIPT attribute,
> in much the same way as the STYLE attribute can incorporate style
> changes. 

The idea of a generic SCRIPT attribute was proposed a while back.
It would have to allow for binding multiple events to handlers,
since SGML doesn't allow you to have more than one occurrence of
the same attribute in any given element. Another idea was to use
an element to bind each event to a handler. This was rejected
in favor of the explicit event attributes (simpler and already
deployed). Some people suggested the goal of being able to
provide editing enviroments for scripting that could track which
handlers are used for which events, with out the need to understand
the scripting language.

Conceptually having an explicit list of events may make it easier
to achieve interoperability by forcing us to define an language
and platform neutral model for events. This is being done in the
W3C Document Object Model working group.

> Would this go any way to meeting your reservations? What it would
> then be doing would essentially split a fully-laden HTML document
> into three distinct sections: 
> 
> 1) Main document, including text, graphics and hyperlinks
> 2) Style sheet, governing presentational output
> 3) Script, governing interactivity.

Styles are easier to share across pages. Scripts tend to be
more specific to the particular page design. This encourages
designers to place script statements in the page. The combination
of onclick etc. attributes, script elements and linked scripts
allows for an effective choice of where to place script statements
facilitating the adoption a clean coding style. Bad programmers
will always write messy programs though ...

Regards,

-- Dave Raggett <dsr@w3.org> http://www.w3.org/People/Raggett
phone: +44 122 578 2521 (office) +44 385 320 444 (gsm mobile)
World Wide Web Consortium (on assignment from HP Labs)

Received on Thursday, 10 July 1997 07:03:28 UTC