Show / Hide Solution
This solution arose over a lunch at Jack in the Box with my former coworker, Cody Lindley. We pondered if it would be possible, and I decided to find out. The following has nothing to do with Ajax, so don’t bookmark it as such.
Well, I got to thinking: Why not hide things with CSS by default, but then provide a contingency plan with
In his example, he uses
noscript directly in the
However, after reading the spec, I could not find where it specifically said not to use
noscript in the
head. It stands to reason that if
script is allowable, then
noscript should be too. Using that basic logic, and adhering to the principle set forth in the Noscript Spec, I think this is a viable solution…
The NOSCRIPT element allows authors to provide alternate content when a script is not executed. The content of a NOSCRIPT element should only be rendered by a script-aware user agent in the following cases: The user agent is configured not to evaluate scripts. The user agent doesn’t support a scripting language invoked by a SCRIPT element earlier in the document. User agents that do not support client-side scripts must render this element’s contents.
According to that definition, the way I’m proposing
noscript be used is perfectly legitimate. Despite that, the validator has a little problem with it. However, given recent dissention with the W3C process and validator, voiced by Zeldman and Hoehrmann, I think that perhaps we should err on the side of usability and accessibilty as opposed to some automated checklist.
In fact, there was an entire panel at SXSW, entitled Standard Deviation, devoted to discussing situations in which not using web standards are actually in the best interest of the end-user. I think that this could possibly be one of those instances, but I am really not sure.
So, all that being said, here is the example: Show / Hide + Noscript. Do with it what you will, depending on if you think the validation issue really matters. Also, I’d be curious to hear what you guys / gals have to say about the issue at hand. Is this an acceptable use of the
The thoughts and opinions expressed here are mine alone, and are not necessarily shared by any other living person.