I know in jQuery, $(callback)
is the same as jQuery(callback)
which has the same effect as $(document).ready()
.
How about
First off, jQuery()
is not the same as $(document).ready()
$()
is a shortcut for jQuery()
and...
$(function(){ ...});
is a shortcut for $(document).ready(function(){ ... });
Thus:
jQuery(function(){ ... })
Will function the same as
$(document).ready(function({ ... });
But...
jQuery('#foo').css("background-color", "#f00");
would not function the same as
$(document).ready('#foo').css("background-color", "#f00");
So...
jQuery()
is not the same as $(document).ready()