Different forms of $(document).ready

$ is the jQuery object itself, which when called implements a whole pile of different interfaces. $('string') runs a selector or constructs a node; $(domElement) wraps an element… and $(a_function) is a convenient short hand for $(document).ready(a_function). See the jQuery API docs for (much) more information.

A note in passing: $(function () { ... }) is shorter, but if you ever want to search for all of your on-ready events, you might be wishing that you had .ready to search for 🙂

Leave a Comment