$(function() is shorthand for $(document).ready(function()

They do the same thing.