Re: Scripts...

scripsit Ville Skyttä:
> On Fri, 2002-05-10 at 23:47, Liam Quinn wrote:
> 
> > > Um, since we are on the topic of Scripts, and not to diverge, but how on
> > > earth do you get JavaScript passed XHTML?  It wants a "type" and I don't
> > > know what "type will satisfy the validator and not kill the script.  Any
> > > ideas?
> > 
> > type="text/javascript"
> 
> Maybe a nitpick thingy, but I'd rather not recommend using
> "text/javascript" since it is not officially registered in IANA [1].
> 
> "application/x-javascript" would IMHO be a better, more established
> choice, that's what for example Apache sends by default.  See also [2].

\begin{kvetch}
How come no one's ever registered a MIME type for JavaScript?
\end{kvetch}

Ville has a very good point here.  I have to admit I've been blindly
following the HTML4 spec on this, but I should not be comfortable
advocating a counterfeit MIME type.

In re www-validator, the Validator shouldn't care so long as the value
of `type' is CDATA, right?  It doesn't care that a value of `href' is
"javascript:B.S." . . .

Might it be a desirable feature to check that `href' has as its value a
valid URI, that `type' has as its value a valid MIME type, or that
`lang'/`xml:lang' have valid language codes?  It wouldn't be an error,
since the DTDs don't specify (except in comments) anything but CDATA,
but a warning might be useful.

-- 
Thanasis Kinias
Web Developer, Information Technology
Graduate Student, Department of History
Arizona State University
Tempe, Arizona, U.S.A.

Ash nazg durbatulūk, ash nazg gimbatul,
Ash nazg thrakatulūk agh burzum-ishi krimpatul

Received on Friday, 10 May 2002 21:52:01 UTC