Valid positioning of script elements

I note from the HTML 4.01 DTD and from coming a cropper on the
validator that one may only insert <script>s at block-level,
inline, or in <head>. It is invalid for a script to live in
structural markup such as <table>, <tr>, <dl> and so on.

Is there any particular rationale behind this definition, or is
it simply arbitrary? (It differs from every browser's
implementation of <script>, though of course that on its own
doesn't mean anything.) Is there any chance of a change in the
future?

It would be quite useful to me to be able to, for example,
document.write(some extra table rows), to produce content
that only appears when JavaScript is enabled (with different,
backup behaviour where scripting is not supported, natch).
The alternative is to write <tr> and <td> elements with
block-level <script>s inside them, leaving empty rows
when scripting is unavailable. This does not appeal to
me aesthetically. :-)

-- 
Andrew Clover
Technical Support
1VALUE.com AG

Received on Monday, 5 June 2000 14:47:29 UTC