W3C home > Mailing lists > Public > www-html@w3.org > October 2000

Backward Compatible DHTML

From: Ben Morris <bmorris@activematter.com>
Date: Fri, 27 Oct 2000 08:58:19 -0400
To: <www-html@w3.org>
Message-ID: <NEBBJJFGELAFJNCPAOABGENNCAAA.bmorris@activematter.com>
Is anyone on the list aware of a good way to use Javascript to disable an <a
href> tag for users that have javascript enabled.

I am working on a site that uses pop-up menus (using DHTML layers).  Right
now the menu is activated onMouseOver, and the link that is moused over is
still a working link so that those without javascript can use the page with
no problems.  I could make the link a dead link, but that would make the
page backward-incompatible.

What would be ideal would be a dead link for those with javascript, and a
working link for those without.

I was thinking of something to the effect of.

<a

<script><!--
if (javascriptEnabled = 'yes') {
    document.write("<!--");
}
//-->
</script>

href="page.htm"

<script><!--
if (javascriptEnabled = 'yes') {
    document.write("-->");
}
//-->
</script>

onMouseOver="popUp();">Text/img that will create popup</a>
Received on Friday, 27 October 2000 08:55:18 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 27 March 2012 18:15:44 GMT