JavaScript is possibly the single most argued-over technology on the web. It is very powerful, allowing client-side scripting that (when it works) can bring a page to life, adding functionality and making a user's experience much more enjoyable. It is also, sadly, the technology used to spawn popup windows on the unfortunate folk using poor browsers, and the technology used by teenage girls to make a string of hearts follow the mouse around the screen.
It is because it is so powerful, and so often misused, that there is so much argument about it. One the one hand, there are thousands of legitimate uses for JavaScript, from client-side form validation (not safe by itself, but can save a user having to load a new page to se a field they missed on a form) to time and date-related functions. On the other hand, people can grab a list of the last 10 sites you visited, your email address, and more, and without you even seeing it.
For those reasons, and many others, there are a great many people who do not use JavaScript. Many decent browsers allow you to turn JavaScript off easily and quickly, and many browsers simply do not have JavaScript support. Search engine spiders, too, cannot make use of JavaScript. Which means you have to be very careful when using it.
The main mistake made with the use of JavaScript can be seen on all too many sites. Many web designers and developers assume that, because so many people use Internet Explorer, that everyone must have JavaScript support, when the truth is that only around 80% - 85% of users actually have JavaScript supported or turned on.
Many would ignore this fact and plough on, making a site unusable for those without JavaScript, instantly preventing a huge proportion of potential customers from actually using their site. Even ignoring those users without JavaScript support, the number of users who will simply never find your site because you are not listed in any search engine results is astronomical. As soon as you make JavaScript an integral part of your site, you are losing sales, and then you might as well just pack up your dotcom and take up a new career.
It is usually better to think of JavaScript as an add-on. If you can save the user some time, or make their browsing experience easier or more enjoyable with the use of JavaScript, then by all means do so. If you can save them having to refresh a page when they submit a form, or give them more navigation options without cluttering up the screen, by all means, go for it. If you must use JavaScript for something important, always provide alternative content through the "<noscript>" tag. And always test your site in a browser with the JavaScript turned off (see bottom of page).
There is no reason JavaScript should be so widely hated. It can be (and often is) misused, but that doesn't mean it cannot be used well on occasion. Used correctly, it can make a user's experience on your site much more enjoyable and productive, and that is what you should be aiming to do if you ever want them to return.
How to turn JavaScript off in browsers
Opera
- Press F-12 and uncheck "Enable JavaScript".
Firefox
- Click on Tools > Options > Web Features and uncheck "Enable JavaScript".
Internet Explorer
- Click on Tools > Internet Options > Security > Custom Level.
- Scroll down to the "Scripting", and underneath "Active Scripting", select "Disable".
AddedBytes.com is the online playground of 