Is
$(document).ready(function(){});
the same as
$(function(){});
?
I believe it is, actually I'm 99% sure it is but wanted a 'second' opinion
Is
$(document).ready(function(){});
the same as
$(function(){});
?
I believe it is, actually I'm 99% sure it is but wanted a 'second' opinion
Yes
"the document-ready idiom is so common, in fact that there's a shortcut version of it... The expanded version $(document).ready is arguably a better example of self-documenting code; it's much easier to see at a glance exactly what's going on - especially if it's buried in a page of another developers JavaScript!" - Borrowed from - jQuery Novice to Ninja