I have a doubt with the syntax in the Twitter Bootstrap's JS files. This is an example file (bootstrap-dropdown.js):
!function ($) {
/* ... */
/* APPLY TO STANDARD DROPDOWN ELEMENTS -- QUESTION CODE
* =================================== */
$(function () {
$('html').on('click.dropdown.data-api', clearMenus)
$('body')
.on('click.dropdown', '.dropdown form', function (e) { e.stopPropagation() })
.on('click.dropdown.data-api', toggle, Dropdown.prototype.toggle)
})
}(window.jQuery);
Why they have a code block inside the jQuery function $(function(){}) ? I think it works without the jQuery function enclosing.
Thanks