Don't Rely on JavaScript!
Sat, 22 July, 2006 – 11:26 am
Global statistics from thecounter.com show that 6% of the users checked do not have JavaScript running – Direct Link. This translates to 6,819,822 people and potential visitors. 6% is actually quite a high figure and as more people use the web with more methods of connecting (PDA, Mobile Phone etc) that may not support JavaScript and also as more people understand how to switch JavaScript off and may choose to do so for their own security comfort then it's definitely an issue web sites need to start addressing.
Why? you may ask. Today I switched my JavaScript off to look at a site someone was asking about as it just had the title of the site indexed in Google with no description (there was no description or page text to index if you're interested) – however their index page had a redirect on, a flash detector, so I switched my JavaScript off to see what was showing up. Okay that was fine, the page had two links, flash and non flash sites. However I then forgot to turn my JavaScript back on.
I've since been to several sites, almost all of which were not working for me and I couldn't work out how. Usually when a site doesn't work as expected I blame the developer for using an MSIE specific method, something that won't work in Firefox and so won't work for me. I went to the Open University site today from a link in a newsletter I'd received. I was trying to request a prospectus to see what courses were on as I know someone who's interested in doing some web development courses. I got through the first page but then on the second page there were 3 buttons, none of which worked. How can 3 simple buttons have to rely on JavaScript?
Last year my flatemate Annette was booking a holiday on her computer. A hotel and flights to Amsterdam for her and her boyfriend. They went through the site, using MSIE, completed the forms correctly and then paid. The final page with the receipt and details had completely wrong dates on! There was no way of going back in and cancelling or amending their booking. I took a look at the computer to see if something was running that had caused the issue. I checked the settings in the Internet Tools options, JavaScript was running and the options were pretty much untouched from a fresh install. I then went to Windows Update and nothing happened. That's when I realised that JavaScript wasn't running at all! I downloaded everything I could to get it running again and after 3 hours I gave in and uninstalled their security centre software of a virus and firewall. Suddenly JavaScript worked again! It seems that their software (McAfees) had made a download that day and whatever it downloaded it prevented the JavaScript from working. The major issue from all of this was without JavaScript working (and the site not making a check on this) their holiday, which should have been for New Years Eve, was now booked for a week after they'd made the booking, in October. After contacting the company who ran the site they were informed they couldn't cancel and the company pretty much shrugged their shoulders over the issue – most likely because they clearly had created a web site that made assumptions and had no respect for visitors who wouldn't be running the requirements their web site needed!
This is a clear cut issue with a site relying on JavaScript, offering no alternative if JavaScript doesn't work and having no respect for people who may not have JavaScript running. Pretty much a similar issue to accessibility where a site assumes everyone can clearly see their site, isn't colourblind, partially or fully blind and is relying on a screenreader. However sites, and more worse eCommerce sites that have a responsibility to ensure your order or booking is secure and correctly saved, which rely on Javascript just shouldn't be allowed to operate.
So simply put, don't rely on client side scripting to make your sites work!


I'm actually part of the 6%, or potentially am. I use the Noscript Firefox addon to make sure that I have total control over what javascript is running in my browser. I only whitelist sites that really need it or that I trust.
If a site doesn't work without then I can enable it temporarily. It's a decent way of getting rid of all sorts of site bloat and to prevent certain types of adverts appearing. Worth a try – I really like it.
By Rutty on Mon, 31 July, 2006
I tend to keep it on as I do visit sites that use javascript and whilst they work without, it does add to the site or save time clicking other things. But it's crazy when you realise the amount of sites that rely on javascript being switched on. Especially eCommerce sites!
Of course I have the Web Developer toolbar Firefox extension which allows me to switch a few things on and off. Handy when some flash is annoying and you can't switch it off or turn the sound off!
By Sarah on Mon, 31 July, 2006