It's not often a super-important requirement that I run into these days, but in many cases, it is still important to provide functionality to users who either don't have a Javascript enabled browser, or who have it disabled.
It's easy, of course, to use a
<noscript>
tag to show page content to users in that situation. But how do you easily take out content for them?
In the past, I've often used
document.write()
, of course, to write the content. But that can become a nightmare to maintain, especially as that content grows. It's just as bad as trying to write an HTML page using Java servlets, perhaps worse if you take into account the lack of a compiler - it's harder to debug problems. So, today an easy way occurred to me - show the content as
display: none;
, then in the
onLoad
event, display it using Javascript.
It's not a startling revelation, but it might be helpful at times. Of course, it doesn't help if you're dealing with non-Javascript-using visitors who also don't have CSS support, but it should easily eliminate most of the problems you face when trying to provide functionality (or remove it, and provide an alternate) for them.
Hey! Why don't you make your life easier and subscribe to the full post
or short blurb RSS feed? I'm so confident you'll love my smelly pasta plate
wisdom that I'm offering a no-strings-attached, lifetime money back guarantee!
Leave a comment
There are no comments for this entry yet.
Leave a comment