-
Notifications
You must be signed in to change notification settings - Fork 2
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
[BUG] script loading before DOM generation. #17
Comments
That's not really a bug, pco currently already accounts for that and only runs code that depends on the page being loaded when it actually is, that's what the init function is for. Though maybe that's an outdated solution if the defer attribute exists... |
yeah, there is this "dom loaded" event listener but now you usually put script just on the body bc. you dont have to load things before dom is already there. usually, this just makes the browser load the javascript before. what also makes the page a little bit slower, and make run time races error with "new" javascript code (as |
solved by using defer on the tag |
This is going to be solved on the next update. made me lose some time but:
scripts have to be put at the end of the body, not the header, if you put it on the header then it will load BEFORE the dom and fuctions depending on dom will fail and make crashes, and when you are using modals you have to set them into the javascript to close/open them so this made it crash.
The text was updated successfully, but these errors were encountered: