Is there a difference between $().ready() and $(document).ready()

Slight change:

$(document).ready(function() {});

Is equal to:

$(function() {});

As of jQuery 1.4: $().ready(function() { }); no longer works correctly in all cases. From the release notes:

As of jQuery 1.4, if you pass no arguments in to the jQuery() method, an empty jQuery set will be returned. In previous versions of jQuery, a set containing the document node would be returned.

Leave a Comment