From the jQuery API docs site for ready
All three of the following syntaxes are equivalent:
- $(document).ready(handle
I would say its simply the fact that $()
returns an empty object whereas $(document)
does not so your applying ready()
to different things; it still works, but I would say its not intuitive.
$(document).ready(function(){}).prop("title") // the title
$().ready(function(){}).prop("title") //null - no backing document