Maybe you are trying to use jQuery when dom in not build. Try using the function $(document).ready:
(function ($) {
$(document).ready(function () {
$header = $("div.header");
$header.remove();
});
})(jQuery);
About what you asked in the question:
jQuery(document).ready(function ($) {
});
It works because it does the same thing: it binds an event handler readyand passes the jQueryobject as a parameter to the function as $.
Now what did you do before:
(function ($) {
$header = $("div.header");
$header.remove();
})(jQuery);
Here you simply declare an anonymous function with the name $:
function ($) {
}
jQuery , $:
(function ($) {
})(jQuery);