Script Placement Message Question

For technical support for all editions of CSS HTML Validator. Includes bug reports.
Post Reply
Rank II - Novice
Rank II - Novice
Posts: 20
Joined: Fri Nov 09, 2007 9:57 pm
Location: Kent, Washington

Script Placement Message Question

Post by kennedyrt »

A script placed in the <head> section, especially one with the src attribute, generates the message "Avoid placing scripts (especially longer ones) in the head section if possible. Doing this can make the page seem slower to load because the browser must pause to download (if using the "src" attribute) and run the script. Also, DOM content is not loaded yet so it is not available to the script. In most cases it's best to place scripts right before the </body> end tag. This message is displayed only once."

Should this message be issued if the defer attribute, which delays script loading until the page is rendered, is used with the <script> tag?

User avatar
Albert Wiersch
Site Admin
Site Admin
Posts: 3494
Joined: Sat Dec 11, 2004 9:23 am
Location: Near Dallas, TX

Re: Script Placement Message Question

Post by Albert Wiersch »


Yes, that makes sense. In the next v17 update that tip message will not be generated if the "defer" attribute is used.

Thank you for bringing this to my attention.

UPDATE: I've made this change. The new v17 config file (if you want to update now and are using v17) can be downloaded here: ...

Post Reply