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