Simon, just one additional suggestion for capturing the reference to
$:
var dashboard = (function ($){
.
.
.
})(jQuery);
The slight modification simply moves the capture of the closure one
step up in the call stack. That makes it inline with the jQuery
invention and, as an added bonus, I find it cleaner. For those
following this conversation I've included some background information
about why this is necessary in jQuery below.
Nathan
***
As a result of some of the defensive design work done by the jQuery
team, it became possible to have multiple versions of jQuery on the
same page. This provides a few neat tricks such as the ability to
support multiple versions of the jQuery API for different plugins on
the page, as necessary. Eventually though, one of the ideas is to be
able to remove jQuery from the page after instantiation. The idea is
to capture the reference to jQuery in closures where necessary, and
then remove itself from the page (!).
That is also the reason the jQuery variable needs to be caught in
closures for modules: to make sure that the object is always calling
the jQuery instance that it thinks it is.