Are these both the same thing, i.e. ways of saying document ready:
$(function() {
//
});
and
$(function($) {
//
})(jQ
They both are not same.
First code block is used to execute the function on document ready where as second code block is used when we want to execute the code block immediately without waiting for rest of the code to be loaded. But there is some error in your second part of the code. It should be as below.
(function($) {
//
})(jQuery);