Discuss: Let Them Eat Cake
by Aaron Gustafson
- Editorial Comments
12 RE: You must be joking!
Chris,
Did you even look at the example with javascript off? It functions very nicely.
One of the greatest benefits of this technique is the ability to break up long sections of information, removing the need to scroll (which many clients of mine have expressed distaste for), while still allowing for a complete printout.
As far as Mike’s comment about the inability to send section link’s to collegues. Perhaps the script could be extended to show the div referenced in the query string. This would allow the sections to be bookmarked as well as emailed.
posted at 10:55 am on April 16, 2004 by Simon Dvorak
13 A good read.
It is allways good to readdress web development issues. There is something learn from every article even this one.
posted at 11:07 am on April 16, 2004 by Sorvoja
14 yes but
I love ALA, really I do. I find their articles informative and interesting. I think, however, that an astoundingly overwhelming percentage of their articles use a sort of “spice” metaphor for discussing CSS, JavaScript, et al.
“sprinkle in a little CSS”, “add a pinch of javascript”, “just a dash of XSLT”, et cetera, ad nauseum. these colorful, yet contextually prosaic phrases will be all to familiar to longtime ALA readers.
I am no english teacher; god knows I suffer with my own fair share of writing and communication deficiencies. as such, I mean this comment not as a vitriolic barb, but rather a simple plea for understanding. I am sure JavaScript, CSS, DOM, XSLT, and other web tech acronyms can be personified in a bracing new manner, and I have little doubt that the brilliant minds behind this website could bring such theorized syllogisms to life.
thank you for your time, and for the wonderful information you guys disseminate. wordup.
-fish
posted at 12:13 pm on April 16, 2004 by fish
15 Constructive Critisism
I’ll be probably be labeled a troll for this but oh well…
First of of all I didn’t like:
if ((divs[i].id!=“header”) && (divs[i].id!=“footer”)) }
divs[i].style.display=“none”;
Isn’t
if (divs[i].id!=“header” && divs[i].id!=“footer”) divs[i].style.display=“none”;
easier?
Even easier would be
if (divs[i].id==“header” || divs[i].id==“footer”) continue;
divs[i].style.display=“none”;
It is my suspicion that ALA is publishing all these new (sometimes great) DOM articles after PPK said that the average Javascript article on ALA was “mediocre at best”.
I’d recommend http://www.digital-web.com/columns/keepitsimple/accessibility_and_usability.shtml for accessibility and usability. This was good as well. Overall very good.
posted at 01:04 pm on April 16, 2004 by Dante-Cubed
16 Oops
The first code example should have read
if ((divs[i].id!=“header”) && (divs[i].id!=“footer”)) {
divs[i].style.display=“none”;
}
“Javascript Spaghetti”? Why isn’t Javascript being taken seriously? I think I just stop trying. No one can see beyond inaccessibility to a practical use of Javascript.
posted at 01:07 pm on April 16, 2004 by Dante-Cubed
17 javascript: links
Ok, I missed the point at first but then I was even more astounded to see that you are actually using Javascript to write out Javascript links! Why do that when you can apply an event handler instead? These will also prevent users from thinking that these really are links, provided they do look at their status bar.
posted at 01:18 pm on April 16, 2004 by Chris
18 Great Idea!
Despite what people are saying, I like it.
I do think, however, that you should use a Tab Type navigation when styling the list. the navigation you use looks too much links to new pages, confusing users. But tabs would give a better effect, and look more like you are viewing a different section of a current page.
posted at 01:43 pm on April 16, 2004 by Phil Baines
19 Usability benefit?
I don’t see the usability benefit of the demo, but Phil Baines brings up a good point which reminded me of:
http://www.jibbering.com/accessibility/tabcontrol2.html
posted at 01:53 pm on April 16, 2004 by Isofarro
20 RE: javascript: links
Chris,
Did you read this article?
Aaron writes…“The brilliance of having JavaScript rewrite the link as a JavaScript call is that we already know JavaScript is operating on the user’s device, so we are assured that <a href=”[removed]show(‘ingredients’);”> will not be meaningless to the browsing device. If a user’s browsing device does not support JavaScript (or does not support it to the extent that it understands document.getElementsByTagName), the links remain unchanged, jump refs to the different divisions of the page. Likewise, the divisions all remain visible, so both accessibility and usability are well-served.”
Look at the code. It is clean and well structured. The links to the various section headings is not cluttered with eventhandlers. What if one was to change the function name or remove the function altogether? Updating would involve manually changing the function name or deleting the vent handler for each link.
Aaron’s method allows for clean source code and future updateability. Sounds good to me.
posted at 01:54 pm on April 16, 2004 by Simon Dvorak
Discussion Closed
New comments are not being accepted, but you are welcome to explore what people said before we closed the door.
Got something to say?
Discuss this article. We reserve the right to delete flames, trolls, and wood nymphs.
Create a new account or sign in below if you’d like to leave a comment.
Subscribe to this article's comments: RSS (what’s this?)






11 javascript: links ARE bad!
What if user wants to open a such link in a new window?
posted at 10:41 am on April 16, 2004 by Serge Voskoboynikov