JavaScript Library Addiction
May 11th, 2008 in web development | 1 Comment
Hi. I’m Chris and I have a JavaScript library addiction. I’m guessing I’m not the only.
As I was redesigning JibberBook.com, I was trying to locate a small library to create a tab script. The minimum stuff I needed for Mootools amounted to around 32kb YUI compressed (I’m not too happy about Mootools anymore), and jQuery is 29kb packed. I thought about using DOM Assistant, but after looking at the code, decided it was too much. All I needed to do was select elements by class and id, attach an event, and change some styles and classes. Libraries were obviously overkill.
So I ended up just searching for a class selector function and an add event function and wrote everything else myself. Sure I had to search for some cross-browser techniques a couple times and had to do a bit more testing, but it was definitely worth it. The script size is under 2kb, and it’s even unobtrusive.
The moral of this story: Toss off your floaties and dive in, and don’t force your visitors to download 100kb javascript files because you can’t program.

Hi, I'm Chris, a passionate freelance web developer. My languages of choice are PHP and JavaScript, and that's what you'll mostly find in my blog. You'll also find updates about 