I need help understanding this pattern for jQuery plugin authoring. Can somebody explain this simple bit of code for me?
(function($) { /* Code here */ })(jQ
+1 for jfriend00's answer.
But including jQuery in a page overwrites both of the global symbols jQuery and $ (see jQuery.js line 9579) potentially causing conflicts with other libraries that define a global $.
So taking this a step further to also stop the global $ conflict:
(function($) {
// you can use $ here to refer to jQuery
})(jQuery.noConflict());
as demonstrated by: