Why “$().ready(handler)” is not recommended?
问题 From the jQuery API docs site for ready All three of the following syntaxes are equivalent: $(document).ready(handler) $().ready(handler) (this is not recommended) $(handler) After doing homework - reading and playing with the source code, I have no idea why $().ready(handler) is not recommended. The first and third ways, are exactly the same, the third option calls the ready function on a cached jQuery object with document : rootjQuery = jQuery(document); ... ... // HANDLE: $(function) //