ejohn.org
Submitted by: David Walsh

Ultra-Chaining with jQuery

We were having a discussion, the other day, on the jQuery-dev mailing list concerning style and jQuery code. There was some discussion about how it could be improved.

One of the points discussed was concerning the use of callbacks and jQuery(this). Callbacks (passing in a function as the final argument to a jQuery method, to be called later) are used all throughout jQuery code. It’s a rather core aspect of jQuery (especially the use of closures to pass around information).

direct link