How to improve your JavaScript

Tags:

There’s a lot of resources on the internet related to coding JavaScript, but many of them are poor and out of date, which I believe is one of the reasons why a lot of people still can’t manage to write JavaScript code which works in all major browsers (IE, Firefox, Opera and Safari – where possible to test it)

Let’s check out some useful JavaScript resources to improve our skills, ranging from books to blogs and frameworks/libraries.

Frameworks/libraries

Let’s begin with these. I think they are very important, as they can help you get a lot of mundane tasks off your shoulders when developing in JavaScript, and they also are cross-browser compatible so you will have less issues to worry about.

There are many JS libraries around, so I can’t start listing every here, but I’ll just scratch some of the more well known and useful ones.

  • Prototype – A very popular framework which has various features aimed to ease development, such as Ajax and DOM functions.
  • Scriptaculous – A library based on Prototype, which is more biased on providing users with effects, drag and drop and other user interface features rather than basic things, as that’s what Prototype does.
  • jQuery – A similar library to Prototype and Scriptaculous. Intends to offer more functionality for less code. jQuery works very well with other libraries as it is fully inside the jQuery namespace. It also has a lot of plugins to provide new functionality.
  • Dojo Toolkit – Dojo, which recently reached the 1.0 release, is a toolkit which has a lot: user interface widgets, form validation tools, animation and graphics to name some. The documentation is somewhat confusing in my opinion.
  • Mootools – A lightweight library similar to Prototype and Scriptaculous. Some of the features are inspired by Prototype, so if you’ve used that before, trying out Mootools (or the other way around), should be easy.
  • MochiKit – Makes JavaScript suck less, according to their homepage. Sports a similar feature set as Prototype + Scriptaculous.
  • The Yahoo! User Interface Library – Like the name says, YUI has many useful user interface components, such as auto completion, calendars, tabs and trees.
  • ExtJS – Ext started out as a bunch of extensions for YUI. It provides a lot of useful UI widgets and utilizes other functionality from YUI, jQuery or Prototype/Script.aculo.us, so you can pick your favorite of these to use together with Ext. Ext can be used to provide a very desktop-like experience.

A lot of these libraries do the same things. In the end what matters is most likely if you like the coding style used by a certain library or not. If I didn’t mention your favorite library, let me know and I’ll check it out.

In addition to these, I think there’s one smaller single-purprose library worth mentioning: The /IE7/ project, which makes older IE versions 5 and 6 behave more like modern browsers. It fixes many of the typical IE issues, so if you’re having problems it could be worth checking this one out.

Blogs and sites

Here’s a few useful sites and blogs/posts to help you out with JS.

Articles etc.

Other useful sites

I also want to mention these two sites as they are very useful:

  • JavaScript packer – Compresses JavaScript to make files smaller. Very useful if you want to save bandwidth and make your pages load faster.
  • Mozilla Developer Center: JavaScript 1.5 Reference
  • Aptana Studio – An IDE for coding JavaScript. Has a lot of good features such as auto completion, content assist and JS debugging. Word of warning: done with Java, so it can get a bit slow at times with big projects.

There are probably other sites too, so if you know any good resources, let me know.

Books

Please be aware that I have only read the JavaScript and DHTML cookbook – I’m recommending the others based on what I’ve heard and what I know about the authors.

In closing

There’s a lot of information on these pages and books I’ve listed. I’m sure there’s a lot more where these came from, so if you know any good JavaScript resources, I’d be more than happy to hear about it. So, post a comment, mail me, IM me, you know the stuff.