Sponsor: The CSS Anthology
The CSS Anthology: 101 Essential Tips, Tricks & Hacks (external link)
Blog Entry
How Not To Use JavaScript
Published on the 9th of August 2005
The other day I was browsing around Hewlett Packard's website (external link) for a printer driver that would work with my Mac. I never did find the driver, but I don't blame them as the printer is ancient. While browsing I switched tabs for a moment to test the usability of a system I was working on that used "unobtrusive" JavaScript. I turned off Javascript in my browser. After messing around a bit with some coding to compensate for lack of JavaScript support, I switched back to my HP tab.
I instantly saw that the layout was destroyed. All of the coloring and structure was completely discombobulated. I turned on Javascript and saw that the layout again worked. This odd dependency on JavaScript puzzled me, because I've never heard of a designer using JavaScript to do that much in a layout.
Hewlett Packard's use of JavaScript is a fine example of how you shouldn't code. Relying on JavaScript that much for a design to properly function has its gigantic pitfalls. Internet Explorer lacks support for the modern uses of JavaScript (DOM) and many users turn off JavaScript, believing that everything malicious revolves around it.
JavaScript has lied dormant for a few years, when the "Wow, I can move things," coolness factor wore off. Once the wide spread rumor among non-web developers that JavaScript is what hackers use to harm your computer, JavaScript usage considerably dropped. It was too risky to depend a lot on JavaScript for your website.
Due to the lack of Internet Explorer 6's support for truly customizing your JavaScript experience, most users just turn it off. Opera and Firefox users are able to control their cookies and JS preferences quite easily. Recently, Javascript usage has increased as the development of DOM and DHTML take off.
2005 was marked the year of DOM (external link) by many web developers, as the progression of CSS is on hold until CSS3. JavaScript should be used in an "unobtrusive" method, allowing users without the support to still use your website. Hewlett Packard's scripting was completely unusable.
Remember when you're designing webpages, use JavaScript at a point where it only enhances your page. Have a good weekend and code properly!
Comments
-
stickycarrots (external link) (6 Aug 2005 0:37)
I took a look at it without javascript and boy does that look terrible. I agree with you. What were they thinking?
-
Matt Oakes (external link) (6 Aug 2005 5:42)
wow thats bad. Never seen it done likw that before.
-
Ethan Poole (external link) (6 Aug 2005 6:27)
I remember that a lot of my older layouts had large dependencies on JavaScript, but I don't think that I ever went that far. On AvidGamers you really had to rely on JavaScript for almost every extended feature, so it was a given that your members would have it enabled.
In HP's case their website could have been as dynamic as it is (the layout changes each time) if they used PHP. You could use ASP too, but that comes with a huge price.
-
Frans (external link) (8 Aug 2005 7:43)
Yeah, on AG I basically let AG write all of its stuff into arrays and then rewrote everything the way I wanted it using Javascript. ;)
What's the huge price of using ASP then?
-
Mark Lloyd (external link) (8 Aug 2005 16:06)
its made by microsoft.. thats more than im willing to pay.
-
Daniel Malmqvist (external link) (8 Aug 2005 16:34)
Haha, I though a company like HP should know a little bit more about web design then that. Suckers :P
ASP, I worked with it when I first came to Lowter. Which was quite a long time ago. Now I'm basically gonna throw away all that Microsoft shit away. I really don't like how Microsoft is control the market. :P
-
Ethan Poole (external link) (8 Aug 2005 18:35)
ASP developers are usually paid more - because they have a Microsoft certification. Windows Server edition isn't too cheap either, and requires much more maintence than an Linux system running Apache. In the end ASP cost more for a company.
-
Frans (external link) (9 Aug 2005 8:34)
In the case of a company like HP I don't think that twice or perhaps thrice the cost is "a huge price". ;)
-
Daniel Malmqvist (external link) (9 Aug 2005 9:52)
True that Frenzie. I do think HP can afford alot more then they are paying for their website :P I mean c'mon it's a company that exists all over the world for gods sake ;)
Sponsor: Songbird Media Player
Desktop web player, a digital jukebox, and web browser mash-up. (external link)

