W3C home > Mailing lists > Public > w3c-wai-ig@w3.org > October to December 2000

Re: How do I make JavaScript "pop-up help" accessible?

From: David Holstius <holstius@msu.edu>
Date: Mon, 6 Nov 2000 16:28:05 -0500
Message-ID: <00d801c04838$741ed500$f1b1b718@elngsng1.mi.home.com>
To: "Bailey, Bruce" <Bruce_Bailey@ed.gov>
Cc: <w3c-wai-ig@w3.org>
Something that I've done in the past is to make a Javascript function that
writes Javascript code into the document. I don't know how "official" this
is, but it seems to work. Something like:

function WritePopupHelp( helpFile, linkText ) {
    var s = '<a href="javascript:Help(\'' + helpFile + '\')">' + linkText +

Combine it with a Help() function that you define, and then code your actual
HTML like:

<script type="text/javascript">WritePopupHelp('foobar.htm', 'Definition of
<noscript><a href="foobar.htm">Definition of foobar</a></noscript>

That way, only users with JS enabled will get source that invokes JS.

It becomes a little redundant to hand-code all those script/noscript pairs,
so if you have the luxury of server-side processing you can wrap the
generation of each script/noscript pair in a server-side function. (You
wouldn't want to put it in another Javascript because then folks w/out JS
wouldn't get *anything*.)

I'd like to know what WAI-IG members think of this workaround.

David Holstius

> On Monday, November 06, 2000 2:19 PM, Bruce Bailey wrote:
> I site I am reviewing generates context-sensitive "pop-up" help using
> JavaScript.  I imagine they are doing this for the effect that:
> (1) The main window stays open;
> (2) The new pop-up window is smaller than full-screen and has none of the
> normal browsing controls -- so it doesn't really look so much a web page.
> The pop-up is invoked by code like:
> <A href="JavaScript:Help('foobar.htm')">definition of FooBar</A>
> Obviously, the HTML file is available if one can figure out how to hunt it
> down (it's fairly well hidden).  Lynx just generates a message:  "Alert!:
> Unsupported URL scheme!" and nothing happens.
> Is there an alternative way to code this so that 4x browsers still get the
> no-frills pop-up version, but Lynx (and other JavaScript-free) users get
> regular URL for the help text?
Received on Monday, 6 November 2000 16:27:47 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 13 October 2015 16:21:10 UTC