A very useful jQuery tip which I've picked up, but also noticed that isn't widely known is to do with the common document.ready function. The old way to do it is like this:

$(document).ready(function() {
});

This method is preferred by some developers, because they see it as being more expressive: you are writing a function to be called when the document is ready. Makes sense right?

The shortcut method is like this:

$(function() {
});

Yep, if you just pass a function to the jQuery constructor, it treats it exactly the same as a document ready handler. Pretty neat.

The other thing with this is that you should always write your code to be as portable as possible. $ is a variable used by many different javascript libraries and should your code need to be used in conjunction with one of those other libraries, you'll run into issues. Here's the good news, though - it's super easy to avoid conflicts with other libraries while still maintaining the pretty $ variable. The document.ready function takes one argument: the jQuery object. This means that whatever you name the first argument in your ready handler, that's what jQuery will be in that entire enclosure.

// give $ back to Prototype or whatever it was before
jQuery.noConflict();

jQuery(function($) {
    if ($ === jQuery) alert("woo hoo!");
});

// or if you prefer the more verbose method:
jQuery(document).ready(function($) {
});

Outside that function, $ will be untouched, inside, it's jQuery. It's definitely a good habit to get into!