Re: Using Form Elements for Pages only Intended for Printing

"Jon Hanna" <jon@spinsol.com>

> > Well it's better (but having it as an external script seems very
> > wasteful.)
>
> It hides the script from non js-aware browsers in a way that is both
> valid HTML (which may choke on <[CDATA[) and valid XHTML (which
> doesn't guarantee that anything in a <!--comment--> won't be deleted
> before parsing

Which isn't a problem - especially as there aren't real XHTML browsers
about...

>). Besides which external scripts have a speed
> advantage if the script is used more than once (albeit this only
> really happens with larger scripts),

For a 100byte script it's a lot more than once, and assumes you visitors
both visit multiple pages, and your cache settings are all friendly.

> and it makes source code easier
> to manage especially in the common situation where not all the people
> working on the HTML are familiar with js.

So you have to teach them to add a button with <script ... > it's an
argument, but I don't feel it's a good one.

>  also why have
> > the DIV?
>
> <script> is a block level element. As such it cannot appear in an
> inline situation. Also if a script document.write's then it should be
> seen as being replaced by that code.

It should? which specification states this? it's certainly not the result
in any parsers I've seen (they include both.)

Jim.

Received on Thursday, 10 January 2002 10:36:33 UTC