I\'ve seen four different ways to tell jQuery to execute a function when the document is ready. Are these all equivalent?
$(document).ready(function () {
There is no difference.
$ is the same as jQuery. If you view the unminified source, you will see var $ = jQuery = ... or something to that effect.
The jQuery function checks the type of it's parameter, if it is a function, it treats it the same as $(document).ready(...)
Calling jQuery without a parameter defaults to using document. So $() and $(document) are identical. Try it in Firebug.