News for hackers. Stuff that matters.
Re:Why MooTools (or Why not JQuery) by LogicHoleFlaw on Thursday October 02, 2008 @04:42PM (#322132)
What is the advantage of (function($){})(jQuery) over jQuery(function($){}) ? In either case the jQuery object must be in the namespace, and neither leaves a named function laying about. According to the jQuery API jQuery(callback) is sugar for $(document).ready(callback). The ready event is usually when I want my code to run...

http://docs.jquery.com/Core/jQuery#callback

Re:Why MooTools (or Why not JQuery) by humanchimp on Wednesday October 29, 2008 @10:02PM (#348326)
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.