No. The first one isn t really doing much. Just separating any variables inside from the surrounding scope, and creating a local jQuery
variable inside.
The second one passes a function that is run after the DOM is ready (in other words after the <body>
has loaded).
A common equivalent to:
$(document).ready(function () {
});
is:
$(function () {
});
which does the same thing.
While this:
(function(jQuery){
})(jQuery);
is often written as:
(function($){
})(jQuery);
so that the $
variable is no longer a global variable. Useful if the global $
variable is already in use.