Skip to content

Incorrect use of $('document').ready() #19

@Imran-imtiaz48

Description

@Imran-imtiaz48

You have written:

$('document').ready(function(){
   // code...
});

This is not the correct way to bind the document ready event in jQuery. $('document') creates a jQuery object with a literal string "document", which doesn’t reference the actual DOM document. The correct syntax is:

$(document).ready(function(){
   // code...
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions