The first is a shortcut for .ready() .
The second is simply not true, since you are trying to call an un-called object.
You probably meant the following:
... although it has nothing to do with the DOM.
In your first example, there is an option that combines the two:
jQuery(function( $ ) {
source share