Possible Duplicate:
What does (function($) {})(jQuery); mean?
For the function (function($){})(), I've seen it with the word jQuery in it, why is that?
I’ve seen this used in many places, and I understand that some code ill not work without it… but I have no idea what it does: what is the purpose of this wrapper?
(function($){
...
})(jQuery);
An explanation and/or direction to some good resources would be greatly appreciated!
It defines a scope for what’s inside the function body, keeping it out of the global namespace, while defining
$as an alias forjQuery.