Getting Rid of Noscript
Tuesday November 18, 2008
Some people think using noscript makes a page more accessible, the reverse is true.
Anonymous responses that I received regarding prior articles on getting rid of the noscript tag demonstrate that some people mistakenly believe that the noscript tag can make your page more accessible. In fact getting rid of the noscript tag not only doesn't reduce accessibility, it also makes your HTML more semantically correct, your JavaScript can be less obtrusive, and the entire code will be easier to maintain. So as to clearly demonstrate how to go about improving your page in all these ways by getting rid of the noscript tag, I have a here a very simple example where we just want to display one of two different paragraphs in the page depending on whether JavaScript is enabled or not. I show three different versions, the first uses obtrusive JavaScript and the noscript tag. The second is longer in order to make the JavaScript unobtrusive but keeps the noscript tag. The thirs is unobtrusive, doesn't use noscript and is far shorter than either of the other two. As a second example I show how not using the noscript tag is even more flexible by showing an example where one of two paragraphs is displayed depending on whether or not the browser supports Ajax.
Getting Rid of Noscript


No comments yet. Leave a Comment