The <noscript> tag
While JavaScript can add a lot of functionality to your webpages, you can not count on your viewers being able to use it. Many people have JavaScript turned off in their browser for security reasons, and a number of large companies either install browsers with it disabled or filter out JavaScript from unapproved (i.e. non-business-related) sites. Search engine spiders don't necessarily support JavaScript either. What happens to your web page if a user has JavaScript turned off (or their browser doesn't support it)? Is is still usable and readable? Can people still get the information they need? I'm not just talking about using a proper combination of HTML and JavaScript comments in your body <script> tags to keep people with older browsers from seeing your scripts instead of content. If you use JavaScript to implement drop-down menus, how do non-JavaScript users navigate?
The solution to this issue is the careful use of the <noscript> tag. The <noscript> tag is more or less the opposite of the <script> tag. If a user has JavaScript turned off, or their browser doesn't support JavaScript, the information between the opening and closing <noscript> tags will be displayed. (It will also be displayed if the browser doesn't recognize the <noscript> tag, which is a really good hint that it also doesn't support the <script> tag.) Obviously, you can leave this out and a lot of web authors do, or worse yet, simply tell people that they need a more modern browser, but this is generally a bad idea. Most people who don't have JavaScript access or have it turned off, have a reason beyond ludite tendancies. You want to convince your readers that your JavaScript enabled content is so useful, fun, or interesting that they will either turn it on or come back to your page sometime when they DO have JavaScript access. You also want to provide alternate access to as much information as possible. Keep in mind that while JavaScript can be very useful, if it keeps some of your readers or customers from finding you or what they are looking for, you might be losing more than you are gaining!
The solution to this issue is the careful use of the <noscript> tag. The <noscript> tag is more or less the opposite of the <script> tag. If a user has JavaScript turned off, or their browser doesn't support JavaScript, the information between the opening and closing <noscript> tags will be displayed. (It will also be displayed if the browser doesn't recognize the <noscript> tag, which is a really good hint that it also doesn't support the <script> tag.) Obviously, you can leave this out and a lot of web authors do, or worse yet, simply tell people that they need a more modern browser, but this is generally a bad idea. Most people who don't have JavaScript access or have it turned off, have a reason beyond ludite tendancies. You want to convince your readers that your JavaScript enabled content is so useful, fun, or interesting that they will either turn it on or come back to your page sometime when they DO have JavaScript access. You also want to provide alternate access to as much information as possible. Keep in mind that while JavaScript can be very useful, if it keeps some of your readers or customers from finding you or what they are looking for, you might be losing more than you are gaining!
This site needs an editor - click to learn more!
You Should Also Read:
Comments in JavaScript
JavaScript/Java Newsletter
Related Articles
Editor's Picks Articles
Top Ten Articles
Previous Features
Site Map
Content copyright © 2023 by Julie L Baumler. All rights reserved.
This content was written by Julie L Baumler. If you wish to use this content in any manner, you need written permission. Contact
BellaOnline Administration
for details.