Meteor-feature-requests: Please move <script> tags out of the <body> tag

Created on 15 Dec 2018  路  3Comments  路  Source: meteor/meteor-feature-requests

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

Most helpful comment

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.

All 3 comments

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.

Hey @msavin @klaussner ,

<meteor-bundled-css />

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

Was this page helpful?
0 / 5 - 0 ratings