Archive for December, 2008

jQuery Style Guide from Benjamin Sterling

Just wanted to call attention to two excellent posts by Benjamin Sterling: Better jQuery Code 1 and Better jQuery Code 2. He offers some must-have tips on style, form and best practices. Thanks to @foobar2k for the link.
One addition to his notes on caching selections by setting up references: I’m partial to giving references a [...]

Update: Tracking outbound clicks with Google Analytics and jQuery

A while back I wrote a post about tracking outbound clicks with Google Analytics; way back then (about 6 months ago), the only event that Google Analytics could track was a pageview. Now that they’ve introduced the _trackEvent method of the pageTracker object, events that aren’t pageviews don’t need to count as pageviews anymore; instead, [...]

Avoid bare class selectors in jQuery

It just happened again: I was looking at someone else’s jQuery and I came across something like this:
$(’.button’).click(function() { /* do something */ });
This is a classic case of “just because you can, doesn’t mean you should.” This little bit of jQuery will, indeed, find every element on a page with a class of “button”, [...]

New jQuery Corners Plugin

I’ve used curvyCorners and another jQuery corner plugin, but a new jQuery corner plugin just came across my jQuery Twitter feed, so I wanted to check it out.
A quick peek would indicate that it does work in IE6, but it seems to take a very long time for the corners to render. IE7 is [...]