Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

$(document).ready() never fires if the page is already loaded #28

Open
itsrachelfish opened this issue Apr 7, 2016 · 2 comments
Open

Comments

@itsrachelfish
Copy link
Member

Document ready never fires if it is called after the page is already loaded (for example if the script is loaded via require.js).

There are probably other cases where this could happen as well, like if the script file takes a long time to load and it's placed inside the <body>. Not sure, should be tested more thoroughly.

@itsrachelfish
Copy link
Member Author

I guess this could also happen if a document ready function is inside of a setTimeout or setInterval? Not sure why anyone would do that though...

@itsrachelfish
Copy link
Member Author

You can detect the ready state by using https://developer.mozilla.org/en-US/docs/Web/API/Document/readyState

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant