JavaScript

  1. Home
  2. Computing & Technology
  3. JavaScript
photo of Stephen Chapman

Stephen's JavaScript Blog

By Stephen Chapman, About.com Guide to JavaScript since 2004

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

Comments

No comments yet. Leave a Comment

Leave a Comment

Line and paragraph breaks are automatic. Some HTML allowed: <a href="" title="">, <b>, <i>, <strike>

Discuss

Community Forum

Explore JavaScript

About.com Special Features

Build Your Own Website

Step-by-step advice on how to do everything from choosing a Web host to promoting your content. More >

Connect Your Home Computers

Easy ways to connect two computers for networking purposes. More >

JavaScript

  1. Home
  2. Computing & Technology
  3. JavaScript

©2009 About.com, a part of The New York Times Company.

All rights reserved.