Webstock 08: Monday PM: Simon Willison, Jazz Up your JavaScript

Monday’s second session was a complete change of tack: using unobtrusive JavaScript and JavaScript libraries to improve the usability of your web site. This session was a lot more technical and although I followed most of it I have lots of links and things to follow up when I get back. First some background…

We tend to think of websites as constructed of three elements. Firstly there is the content itself – the words, the images, the links that join it altogether, headings, lists etc. This is written in HTML which does not in and of itself have any information about what it all looks like. The second part is the look and feel of the site, font-faces, sizes, what sits where, colours, background, borders etc. This is handled by the stylesheet(s) written in CSS. Finally there is interactivity which is handled by scripting (programmes) either at the server end (where the website code sits) or at the client (web browser) end.

Several years ago JavaScript had pretty bad press but over the last few years a new style of JavaScript – unobtrusive JavaScript – and the Ajax method, have brought JavaScript to the fore. The idea is to first make your site work well without the scripting, and then add it on top to add functionality and usability. An example would be to have something open in a new window for any user but if they have JavaScript then it might simply change the current page instead. JavaScript libraries are pre-packaged sets of functions that make it unnecessary to write all of your script from scratch each time – therefore speeding up development and I guess standardising functions to some extent.

From our point of view these MAY enable us to do some things (like forms for example) in a more user-friendly way, without a large cost in terms of development time. The downside is that for most libraries the user has to download the entire library, so there is more investigation to be done here. Simon was in particular introducing a library called jQuery. He liked it because its well documented, easy to learn and has a good balance between simplicity and productivity – sounds good to me.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s