tags:

views:

34

answers:

2

Hello All

What is the difference between

$(document).ready(function() {
    //some code here
});

and

$(function() {
    //some code here
});

I feel that they use for the same purpose.

+6  A: 

They are the same thing: http://docs.jquery.com/Core/jQuery#callback

A shorthand for $(document).ready().

Rob Fonseca-Ensor
+1  A: 

It's a shortcut/alias to $(document).ready().

Here's something you might want to read:
Introducing $(document).ready()

o.k.w