[thelist] JavaScript - searching for link and comparing

Pringle, Ron RPringle at aurora-il.org
Wed Dec 22 08:47:19 CST 2004


> Pringle, Ron wrote:
> 
> >Hi all-
> >
> >I'm a neophyte when it comes to Javascript. I'm trying to 
> write some code
> >that will search through my nav for a link matching the 
> current page, and
> >then write a css class to the containing <li> to style it as 
> the current
> >page the user is on.


> Suggestion: Don't bother. A navigation highlight should be a 
> non-link, 
> to avoid pages linking to themselves. You could achieve that via 
> Javascript, too, but it is neither accessible nor usable.


Christian and others who replied-

Thanks for the link to the code Christian. I do understand why this
shouldn't be done in JS. I should've included that in the message.

I had looked at the body ID method, but the site has THOUSANDS of pages, so
that method isn't practical at all, and, as you pointed out, still leaves
the link in place.

I'm mocking this up in Javascript for a presentation coming up. Eventually I
will move this functionality to server-side through ASP. And on that note,
if anyone would like to provide ASP VBscript or Jscript examples on how to
do this, it would be much appreciated down the road.

In general, this site's navigational structure is proving to be a bear for
me in terms of efficiently breaking it up for the user. I'm using PDE for
the menu, which works great, but the amount and depth of links is
overwhelming, especially for anyone using a screenreader. I still haven't
determined how best to tackle that either, so any suggestions on that front
are equally welcome (as would be any off-list recommendations for good
Information Architecture books that might help me in theory or practice).

The site can be seen at: http://www.aurora-il.org/testsite/index.htm

Regards,
Ron


More information about the thelist mailing list