what is difference between
$(function(){ });
and
$(document).ready(function() { });
$(function(){}) is a short cut for the dom ready
A function passed as an argument to the jQuery constructor is bound to the document ready event.