The (function($){...})(jQuery) syntax is used by plug-in developers who want their code to run before the jQuery(document).ready event. It is closure, and it's purpose in this case is to protect the global namespace from variables introduced by the script. Closures also have many other useful applications in JavaScript.