In the modern world of web standards there is no room for the poor implementation of javascript that had swept the web during the days of ‘Ive got a dodgy copy of Dreamweaver, and now I am web designer’, which led to the increase of Dynamic HTML download sites that allowed web masters to copy and paste code into there websites to make text fade in and out and scroll (The best ones where always the big clocks following the mouse around. Superb! I am as guilty as the next programmer).
When it seemed every mickey mouse website was a mixture of animated gifs and random fading text that made you feel that you where on some kind of acid trip. Javascript then entered as Obi Wan would call it the “Dark Times” everything went back to being basic or to the overuse of bad Tweening in Flash.
Javascript has recently gone through some kind of resurgence of late with the emphasis being on “unobstrusive javascript”. What’s this? I hear you cry.
Well, if you were to think of a website as a cake (nicked this analogy from Gaz and Keith): The base of the cake would be your HTML. If you want it to taste nice then it needs to be made correctly using the right ingredients. This means semantic markup using tags that are relevant to the content i.e. using <UL> tags for lists and <DL> for definiton lists, headings in the right place and all that jazz.
When you have finished with your base and you’re happy all the ingredients are there, you can then begin to decorate the cake. Decorating the cake in this case would mean using CSS to apply styles, colours and the general design giving you something that not only tastes good but looks fantastic.
Now this in itself would be enough for 9/10 web programmers / designers. However, we could go really overboard and add a cherry. The cherry, as the title of this article would suggest, is Javascript.
Using the ingredients in place we can add the cherry to enhance the cake and make it look that little bit sexier. The beauty of adding the cherry at the end is if no one likes the cherry (i.e. if the visitor to your website has javascript turned off) then they can take it off and crack on with the rest of the cake.
There is nothing worse than taking the cherry off and finding the whole cake crumbles in to mush because the cake was reliant on the cherry holding it all together.
So in summary where am I going with this?
I am a stickler for web standards although alot of other people out there may not be and there is nothing worse than coming across a web site that relies on the end-user having Javascript or indeed Flash installed to view the content.
Javascript and Flash should be layered on top of the content of a web site to sex it up or to make the end user’s experience more enjoyable.