-
Front-end form validation won’t work for users without javascript, potentially causing errors with database input.
If you rely on javascript to make sure users aren’t entering bad information that could potentially compromise your security or database, you’re respecting your visitors way too much. CAPTCHA’s are a good example. If you rely on a CAPTCHA to keep spambots out, and you’re validating that CAPTCHA with javascript, those spambots are going to get in with ease. Most spambots don’t process javascript, so they’ll submit your form without ever running your onsubmit function, easily going around your anti-spam hoops of fire.
-
Seperation of the three tiers of front end code
We’ve all seen the benefits of separating content from styles. Reduced file size, easier maintainability and cleaner HTML. Well guess what, the same benefits apply when using degradable javascript. Your HTML doesn’t rely on javascript to run, so you don’t have to put script tags throughout your HTML. The file size is smaller because you can take advantage of programming loops to apply effects to certain elements (lightboxes). Overall, it’s easier to maintain and reuse because you don’t have to search for you javascript throughout your website.
-
Some mobile phones don’t have javascript enabled.
Mobile browsing is getting more and more popular. I myself recently signed up for an unlimited data plan, despite the hefty cost. Why? So I can check my RSS reader from the road, Keep up to date with twitter and upload mobile phone pictures to my facebook account. Unfortunately, I can’t sign up to follow someone new with twitter b/c an onclick javascript cal is required to do a fancy inline update. Even if they never planned for a mobile phone audience, if they would have written degradable javascript, I be more satisfied with the product and more likely to pay if they starting charging down the road.
-
<noscript>isn’t reliableWhile a good stopgap back in the 90’s, almost all browsers today have javascript available. For reasons mentioned elsewhere in this article, the noscript tag is not a reliable alternative to javascript. And sadly, most noscript tags are only used to display the message “Javascript is required to view this site”.
-
Harder for clients to break when they want to update one word
If you think your client will be able to edit your entire javascript file without messing something up, we’d all like to know where you’re getting your clients and how can we find ones similar. Seriously though, the risk of a client breaking something in javascript when you rely on it for a drop-down menu or other functionality is great. And wouldn’t it be nice to say to them when they come running to you in panic saying “I BROKE IT!” for you to reply, “Relax, I’ve got a back up method that still allows users to complete their task without javascript”.
-
Users behind a company firewall may not have a choice
Companies are very wary of viruses and spam infiltrating their valuable computer equipment rendering it useless and killing productivity. Several websites have been known to install said software on less secure browsers through javascript and activeX. Cautious system administrators can install software that blocks javascript files from downloading, even though the users browser has it enabled. This is a double whammy in that not only does the user not have javascript running, but the noscript tag won’t run because the browsing thinks javascript is enabled.
-
Users cautious of security threats use plugins to toggle javascript
NoScript, a plugin written for the Firefox Web Browser, makes toggling javascript on and off per site much easier. This means that more users are going to visit your website with javascript off. You always want to make a good first impression with visitors, so why not shown the you site still functions for them while letting them know kindly that javascript will help enhance the visit. Users don’t want to be forced into anything, and will quickly leave if the. only they see is a big nasty message reading “Javascript is required to use this website”.
-
If there is an error in your javascript, the user has no backup functionality
Whether your client has been messing with your perfect code or a new browser upgrade doesn’t play well with your javascript, you should know by now that things will break. With degradable javascript you’ve got a built in back up plan that automatically takes effect if some javascript code doesn’t execute. Believe me, you’re clients will be very impressed when they come to you panicked and you act cool and collected, knowing you’ve got an ace up your sleeve.
-
Javascript pop-ups break tabbed interfaces
Sure, 1999 was a nice year with my San Antonio Spurs winning their first championship, but times have changed and users expect more than one website per browser window. Power users like myself often scan a website, opening interesting links in new tabs for later investigation. How frustrating it is then to go to the new tab and only see a blank page. The culprit, a ‘href’ value of “javascript: void(0);” or the same page I was just looking at, only an added pound sign to the end of the URL (onclick statements are the main culprit behind these cruel jokes). With degradable javascript, users who open a link in a new tab get the page they want the way they want it.
-
Google and other search engines spiders don’t run javascript
If you’re relying on javascript to populate a drop-down navigation bar, you’re potentially hiding pages from search engine spiders trying to gauge the quality of your site.
Any SEO expert will tell you that Google and other search engines use the links to and from your page to help rank your site. If you’ve got all your external links going through a javascript popup that uses code similar to
href="javascript: popup('google.com')", you’re depriving those sites of valuable links. Why bother if it’s not your site you’re linking to? Like I said earlier, search engines factor in outgoing links as well as ingoing, and if they see limited outgoing links your ranking will suffer.
Find out more information on degradable (unobtrusive) javascript:
Article labeled as: accessibility, ajax, compatability, development, javascript, programming, section 508, unobtrusive