meteor / meteor-feature-requests

A tracker for Meteor issues that are requests for new functionality, not bugs.
Other
89 stars 3 forks source link

Please move <script> tags out of the <body> tag #341

Closed msavin closed 5 years ago

msavin commented 5 years ago

I believe it is incorrect in terms of semantics, and it makes inspecting the tag a lot more difficult.

klaussner commented 5 years ago

script elements are allowed in the body (the body element allows "flow content" as children, which includes script elements). Placing script elements at the end of the body is useful to avoid blocking the HTML parser, which has to wait until the browser finishes downloading and executing the scripts that it encounters in the HTML.

Maybe we could move all script elements to the head and add the defer attribute but I'm not sure if that's a backwards compatible change or if/how it affects page load performance.

dr-dimitru commented 5 years ago

Hey @msavin @klaussner ,

<meteor-bundled-css />
klaussner commented 5 years ago

Thanks, @dr-dimitru! Closing in favor of meteor/meteor-feature-requests#267.