My Secret Life as a Spaghetti Coder
home | about | contact | privacy statement
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!


Comments
Leave a comment

There are no comments for this entry yet.

Leave a comment

Leave this field empty
Your Name
Email (not displayed, more info?)
Website

Comment:

Subcribe to this comment thread
Remember my details
Google
Web CodeOdor.com

Me
Picture of me

Topics
.NET (19)
AI/Machine Learning (14)
Answers To 100 Interview Questions (10)
Bioinformatics (2)
Business (1)
C and C++ (6)
cfrails (22)
ColdFusion (78)
Customer Relations (15)
Databases (3)
DRY (18)
DSLs (11)
Future Tech (5)
Games (5)
Groovy/Grails (8)
Hardware (1)
IDEs (9)
Java (38)
JavaScript (4)
Linux (2)
Lisp (1)
Mac OS (4)
Management (15)
MediaServerX (1)
Miscellany (76)
OOAD (37)
Productivity (11)
Programming (168)
Programming Quotables (9)
Rails (31)
Ruby (67)
Save Your Job (58)
scriptaGulous (4)
Software Development Process (23)
TDD (41)
TDDing xorblog (6)
Tools (5)
Web Development (8)
Windows (1)
With (1)
YAGNI (10)

Resources
Agile Manifesto & Principles
Principles Of OOD
ColdFusion
CFUnit
Ruby
Ruby on Rails
JUnit



RSS 2.0: Full Post | Short Blurb
Subscribe by email:

Delivered by FeedBurner