CSS + JavaScript Web Page Menu for public comment and use!

J

Jim Ley

http://phd.netcomp.monash.edu.au/RobertMarkBram/menu/

This example is free for anyone to use, comment or criticise - just
leave my name in it somewhere if you use it in your site!

Any script which hides key navigation content in javascript (which is
not always enabled obviously) is generally a bad idea, a more sensible
approach is to transform an unordered list or something similar that
has considerable meaning and doesn't break the accessibility of your
script when JS was disabled. Perhaps even more importantly it doesn't
hide your links from Google.

Jim.
 
R

Robert Mark Bram

Hi Jim!
Any script which hides key navigation content in javascript (which is
not always enabled obviously) is generally a bad idea, a more sensible
approach is to transform an unordered list or something similar that

An unordered list kept where?

JavaScript cannot open an external file and once I put the list into the
html file I am stuck with having to duplicate that list on every page that
requires a menu - precisely the maintenance task I want to avoid with a
script like this.

I was thinking that frames could be used - the navigation frame document
could be the place to store the list in html, but CSS positioned elements
cannot display accross frame borders, so that won't work either.
has considerable meaning and doesn't break the accessibility of your
script when JS was disabled.

Well, if JavsScript is disabled the whole script is broken... visitors must
have JavaScript turned on to access the example: to be honest I do not think
this is an unrealistic expectation.
Perhaps even more importantly it doesn't
hide your links from Google.

Yes, this is a very good point

Thank you for your feedback!

Rob
:)
 
T

Talc Ta Matt

Any script which hides key navigation content in javascript (which is
not always enabled obviously) is generally a bad idea

Very true, but there's an easy way around this. Just make those buttons
clickable. It'll take users to a page with those same menu options (and
possibly further explaination as to what's there).
 
J

Jim Ley

An unordered list kept where?

Within the document, the problem with author once, see in multiple
URI's is a seperate one, you shouldn't combine them, since javascript
for content is simply too unreliable, so while javascript includes
might've been a solution the %age of clients where it won't work
(including key clients like google of course) makes it inefficient.

There's 2 obviousapproaches, the SSI/server generated one, where you
have each page served by a script on the website, including the
content, SSI is the simplest method of this and it's supported very
widely.

Certain webhosts don't support it, and I'd say go find another if
that's the case, however you might not always be able to do this, or
the site might be such high volume that you don't want the processor
hit (if this is genuinely the case you can probably get funding for
better hardware from somewhere - after all someone's happy to pay for
the bandwidth)

In that case though you can pre-process the documents to static HTML,
probably best to still use SSI for development (since you can run a
suitable webserver on your development box) then you can run a tool
when you publish which combines everything - the main cost is that you
need to upload everything after doing this (or generate on the server,
but that's unlikely if you've not got SSI on the server) So upload
costs are higher.
precisely the maintenance task I want to avoid with a
script like this.

There are better solutions without the problem, a ciwa.site-design or
ciwa.cgi will probably be the place to ask if you need more help after
googling.
Well, if JavsScript is disabled the whole script is broken... visitors must
have JavaScript turned on to access the example: to be honest I do not think
this is an unrealistic expectation.

In the real world, I'm afraid it's very unrealistic to expect
javascript, Google especially would have trouble, running javascript
in a robot is tough, you have to make sure the javascript can't do
anything nasty to your poor little robot.

Jim.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,763
Messages
2,569,563
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top