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

Liam Quinn (
Wed, 09 Jul 1997 22:18:17 -0400

Message-Id: <>
Date: Wed, 09 Jul 1997 22:18:17 -0400
To: MegaZone <>,
From: Liam Quinn <>
Subject: Re: Handling of script attributes (was Re: HTML 4.0 draft
In-Reply-To: <>


At 04:36 PM 09/07/97 -0700, MegaZone wrote:
>Once upon a time Scott Matthewman shaped the electrons to say...
>>I do think, though, that the insertion of script events into tags should 
>>discouraged more firmly, to be replaced by binding from a script in the
>><HEAD> element. Individual event attributes in tags should be 
>>to be replaced by a SCRIPT attribute, in much the same way as the STYLE
>>attribute can incorporate style changes.
>You must have a way to bind event handlers to elements - no way around 
>All the event handlers define are the crossover points between HTML and 
>scripting language.  Note that the language itself is NOT defined - only
>the event handlers.

But many of the event handlers are media-specific, which is unnecessary as 
well as inconsistent with the overall message of HTML 4.0.  There should 
be ways to provide event handlers inline, embedded, or externally, just as 
with style sheets.  Inline, a more generic attribute like SCRIPT (or 
perhaps EVENT) would be consistent with the style sheet approach, and 
would allow new, language-dependent event handlers to be developed without 
having to update HTML standards.  The syntax of the SCRIPT value would be 
language-dependent, but I could imagine something like the following:

<INPUT TYPE=text NAME=email SCRIPT="onChange: validate(this); onFocus: 

or perhaps

<INPUT TYPE=text NAME=email SCRIPT="onChange { validate(this); } onFocus { 
tip('e.g.,'); }">

For embedded or external scripts, the event handlers would be better 
defined in the scripts themselves, allowing authors to apply scripts to 
multiple pages without having to add attributes like onClick, whose media 
dependencies should make them deprecated in HTML 4.0.

>You can inline scripts, sure - you can also inline style sheets.

But more often than not an external style sheet makes more sense.  Inline 
styles are not often appropriate, especially since they implicitly apply 
to all media.

>Note that you can already 
>use the SRC attribute on a SCRIPT element to call an external script.

This syntax makes little sense given the following alternative:

<LINK REL=Script HREF="yourscript.js" TYPE="text/javascript" TITLE="Form 

The use of an empty element seems much more sensible than a container for 
external scripts.

>Sure it will be abused - but making the rules tighter will not stop that, 
>will only hamper those who want to do decent work.

A lot of people avoid using client-side scripting because of the enormous 
number of bugs and inconsistencies across browsers.  Now would be a good 
time to decide on a better way of providing scripting hooks in HTML.  New 
methods, unsupported by the old, buggy browsers, will allow authors to use 
scripts with worrying about being bitten by bugs (until browsers actually 
start supporting HTML 4.0 :)).

Version: PGP for Personal Privacy 5.0
Charset: noconv


Liam Quinn
===============  ===============
Web Design Group            Enhanced Designs, Web Site Development
======  PGP Key at  =====