Function:
$( document ).ready(function ( ) {
});
Translated to:
$( document ).on( 'ready', function (e) {
})
Same thing with these abbreviated features:
$( element ).click( function ( ) { } );
$( element ).hover( function ( ) { } );
$( element ).load( function ( ) { } );
$( element ).scroll( function ( ) { } );
From the documentation .click( handler(eventObject) ) :
This method is a shortcut for .on( "click", handler )the first two options, and .trigger( "click" )- in the third.
Updated Answer - The Difference!
$(document).on( "ready", handler ), jQuery 1.8. , , .on( "ready" ) . : .
-
# 2
jQuery(function(){});
jQuery(document).ready(function(){});
, .