jQuery document ready

I’m always forgetting the syntax for the jQuery ‘document ready’ event. Which is an embarrassment because it’s so simple:

$( document ).ready( handler )
$().ready( handler ) (this is not recommended)
$( handler )

I used to use the $( document ).ready( handler ) syntax, but starting today I use the $( handler ) syntax.

Leave a Reply