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

RE: Any examples of <NOSCRIPT>?

From: Jon Hanna <jon@spinsol.com>
Date: Wed, 21 Feb 2001 10:37:51 -0000
To: <w3c-wai-ig@w3.org>
Hash: SHA1

> Does anyone know of a real life effective use of the NOSCRIPT
> element?

Something I've done before but can't find any examples of is as
follows (most of the code is commented pseudo-code in a place where
you can't really have a comment, but you should get what I mean).

<script type="text/javascript">
  if (document.all){//IE4+ object model available
   document.write('/*HTML code for dynamic menu using IE4 object
  elseif (document.layers){//NS4+ object model available
   document.write('/*HTML code for dynamic menu using NS4 object
  else{//script is available, but neither of the object models used
for the menus
   document.write('/*HTML code for non-dynamic menu*/')
	<!-- HTML code for non-dynamic menu -->

Now there are still some possible issues with this (i.e. those issues
with screen readers based around browsers that can interpret dynamic
menus, but not necessarily well) lets for the sake of argument assume
my dynamic code is perfect in this regard - though I admit I doubt it
was - and you have <noscript> giving you a real alternative.

If I find a full example from real life in the next few days (I know
I've written at least one somewhere) I'll let you know.

One comment:

In much of my uses of javascript I have been able to provide an
alternative not with noscript, but with how I use the event handlers.
Commonly you have a link that activates a script when clicked, it is
often easy to make this degrade as such:

<a href="noscriptalternativeofjavascript.html"
onclick="activateFuntion();return false;">

in which case the return false stops the href of the link being
activated if script is available, but not if it isn't. Similarly:

<a href="alternative.html" onclick="return(activateFunction())">

In this case activateFunction returns true if it can't fulfil it's
function (say an object it needs is unavailable on the browser),
causing the link to go to the alternative html page. It returns false
if it fulfils its function. Browsers without script will go to the

Version: PGPfreeware 6.5.1 Int. for non-commercial use

Received on Wednesday, 21 February 2001 05:37:40 UTC

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