-
Notifications
You must be signed in to change notification settings - Fork 22.4k
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
Writing forward-compatible websites is outdated #19717
Comments
It is a bit more complex than this. If you speak about something related to the window, you still prefix it. I would say But if you speak about something on the global scope, like |
I was looking this another day and was confused about this section, https://developer.mozilla.org/en-US/docs/Web/Guide/Writing_forward-compatible_websites#avoid_missing . Is leaving out ">" a convention that people were doing? You can write all sorts of incorrect syntax that will seem to work in browser. But highlighting just one example feels weird. Writing correct syntax should not be just future proofing but good practice always anyway. I think it would make more sense to me, if the emphasis would be that "write correct syntax AND use some validation tool to find trivial mistakes". And then links / mentions where you could find more info about that. |
The point about "qualify your globals" is still fair. We could recommend |
* removed vendor prefix advice * address issue #19717 (comment) * remove space
MDN URL
https://developer.mozilla.org/en-US/docs/Web/Guide/Writing_forward-compatible_websites
What specific section or headline is this issue about?
javascript
What information was incorrect, unhelpful, or incomplete?
I think we've switched to recommend not using window. and this article recommends using window.
This page needs some modern love.
What did you expect to see?
Modern best practices
Do you have any supporting links, references, or citations?
No response
Do you have anything more you want to share?
No response
MDN metadata
Page report details
en-us/web/guide/writing_forward-compatible_websites
The text was updated successfully, but these errors were encountered: