Writing jQuery/javascript that doesn’t suck
Old content alert!
Thanks very much for visiting my blog. Always happy to have people read my stuff but just thought I should point out this post is years old. If it's about technical stuff there is a possibility that it is no longer relevant, if it's a bug report/fix I'm hoping that it should now have been fixed.
Of course if this is what you're looking for and it does work then great, just don't say I didn't warn you...
At the start of the year I was asked by the London Web Standards Group to do a talk at their January meet-up and after a bit of thinking I decided to talk about writing jQuery/javaScript that doesn’t suck; I’ve had to clean up plenty of badly written code in the past and I therefore thought I had some decent things to say. It must have gone well as the London jQuery user group asked me to give it again in their July met-up (which is on the 4th July). I included reference to plenty of external sites in the talk and they can ALL be found in this post (and a few extra bonuses).
The slides
The links
Organisation
- JS Lint – the official site
- Crockford Facts
- Essential JavaScript and jQuery design patterns – FREE BOOK
- requireJS
- A thread on amsuing thread on ‘best code comments’
- JSDocToolkit – project page on Google code
- Documentation-Driven Design for APIs by Frances Berriman on 24ways.org
I like running jsLint as part of my build process, and it’s actually pretty easy. If you’re using the HTML5 boiler plate it’s built into that and if you’re a git user you can install which runs it against your JS on each include and warns you of any problems – git pre-commit.
Performance
- The Mysteries of JavaScript Fu by Dan Webb
- Event delegation with jQuery by Brandon Aron
- Writing Efficient JavaScript by Mark ‘Tarquin’ Wilton-Jones on dev.Opera






