$(function() {
})
<script>
(function() {
})();
</script>
All of the following syntaxes are equivalent:
$( handler )
$( function(){ handler } )
$( ).ready( handler )
$( document ).ready( handler )
$( "document" ).ready( handler )
$( "img" ).ready( handler )
NB! Don't use the second one $( ).ready( handler )