-
Notifications
You must be signed in to change notification settings - Fork 23k
Remove onload and DOMContentLoaded handlers #41079
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Contributor
bsmth
reviewed
Sep 11, 2025
bsmth
approved these changes
Sep 11, 2025
Member
bsmth
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great cleanup, thank you 👍🏻
Co-authored-by: Brian Smith <[email protected]>
wbamberg
added a commit
to wbamberg/content
that referenced
this pull request
Sep 15, 2025
* upstream/main: (32 commits) FF143 GPU import external texture experimental relnote (mdn#41126) added ff release note for nested pseudo-elements (mdn#41146) Add a page for SSRF attacks (mdn#41105) New CSSOM view API landing page, move CSS guides under (mdn#40547) 40778 color input value (mdn#41086) Synchronize with BCD v7.1.5 (mdn#41116) Cross-reference `:target` and `::target-text` pages (mdn#41121) Fix content issues (mdn#41125) Make all JSON code syntactically valid (mdn#41120) Fix the link name with actual heading (mdn#41117) Associated listed form controls (mdn#41096) Mention `new Set()` accepts `undefined` (mdn#41106) chore: correct the `timeRange` function name (mdn#41107) Mention that custom elements constructors can't be directly called (mdn#41069) chore(deps): bump @mdn/fred from 1.3.2 to 1.4.0 (mdn#41111) Public-key cryptography glossary page: add headings and links (mdn#41092) Improve caret color demo contrast (mdn#41104) Fix supported algorithms for HKDF and PBKDF2 (mdn#41100) Update MongoDB example to async/await (driver v5+) (mdn#41102) Remove onload and DOMContentLoaded handlers (mdn#41079) ...
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Content:Accessibility
Accessibility docs
Content:CSS
Cascading Style Sheets docs
Content:HTML
Hypertext Markup Language docs
Content:JS
JavaScript docs
Content:Learn
Learning area docs
Content:Media
Media docs
Content:WebAPI
Web API docs
size/xl
[PR only] >1000 LoC changed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Listening to
DOMContentLoadedorloadfor manipulating DOM is mostly an unnecessary practice. Usually, one can safely modify DOM simply by placing the script at the end of the file. It does avoid blocking render, butasyncdoes that job as well. However, the most common context for using this trick is for placing the script in<head>, which is a bad practice to begin with (since if you want to defer execution anyway you might as well defer parsing). It's definitely useless in our live sample / interactive example system, and most examples don't do this anyway, so for consistency I'm removing the rest.(Tip: review this PR with hide whitespace.)