W3C home > Mailing lists > Public > w3c-wai-ig@w3.org > January to March 2002

RE: Using Form Elements for Pages only Intended for Printing

From: Jon Hanna <jon@spinsol.com>
Date: Thu, 10 Jan 2002 15:24:22 -0000
To: "WAI Interest Group" <w3c-wai-ig@w3.org>
Hash: SHA1

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

 but it's still not perfect, you're now assuming the
> javascript: pseudo protocol exists, which is unwarranted,

I do prefer to use onclick, it is legalistically better, I agree.

 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. The code must be valid both
before and after this replacement. Hence outputting a <a> element
without also outputting a block element like <div> is generally
illegal, unless the script is in an element that can accept either
block or inline elements (div, td, th)

Version: PGPfreeware 6.5.3 for non-commercial use <http://www.pgp.com>

Received on Thursday, 10 January 2002 10:25:08 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 20:36:06 UTC