What's the difference between $(document).ready(…) and $(function() {}) in jQuery? -
what's difference between:
$(document).ready(function() {// something}); and
$(function() {//do something}); in jquery?
$(document).ready(handler) $().ready(handler) (this not recommended) $(handler) are equivalent.
actually, can call .ready(handler) on any jquery object, no matter contains, , same thing:
ready: function( fn ) { // attach listeners jquery.bindready(); // add callback readylist.add( fn ); return this; },
Comments
Post a Comment