[thelist] Incorporating a NOSCRIPT declaration where the script is in the header

Christian Heilmann codepo8 at gmail.com
Wed Jan 25 14:36:39 CST 2006


> This work really nicely. Unless the browser has Javascript disabled.
> No real problem there, but when I check for AAA or 508 compliance, I'm
> told:
> Ideally, I'd like  to add the noscript element in place of or
> underneath the stylesheet switcher,  but I can't work out how to
> accomplish this - I'm having a "Senior  Moment"...
> Any ideas?

Yes, don't rely on JavaScript from the start and you won't have to fix
your mistake by adding another mistake - namely adding NOSCRIPT.

Script inside a body element is bad, as it mixes your HTML and
scripting, which should happen in two different documents. Only that
way JavaScript can really be powerful, as you can apply it to many
documents at the same time.

If you have HTML dependent on JavaScript - like your links - then
_generate_ this content via JavaScript instead of messing up your
HTML.

So, options are:

- Use a style sheet switcher on the server side (everybody wins by
that): http://www.alistapart.com/articles/phpswitch/
- Use a switcher that works on the server side and is enhanced by
JavaScript on the client side:
http://24ways.org/advent/introducing-udasss
- Learn about unobtrusive JavaScript and roll your own JS switcher
that only applies itself when JS is available:
http://onlinetools.org/articles/unobtrusivejavascript/
- Read about outdated JavaScript ideas:
http://www.wait-till-i.com/index.php?p=104

HTH
Chris



--
Chris Heilmann
Blog: http://www.wait-till-i.com
Writing: http://icant.co.uk/
Binaries: http://www.onlinetools.org/



More information about the thelist mailing list