$(document) passes the document element to JQuery.
$('document') passes the CSS selector 'document' to JQuery.
Neither is necessary as the ready method in jQuery should no longer be called directly.
You should either use:
and so run the code straight away without needing to test ready.