Reputation: 4503
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.
Upvotes: 0
Views: 61
Reputation: 25820
It's a shortcut/alias to $(document).ready()
.
Here's something you might want to read:
Introducing $(document).ready()
Upvotes: 1
Reputation: 15621
They are the same thing: http://docs.jquery.com/Core/jQuery#callback
A shorthand for $(document).ready().
Upvotes: 6