Where
should I put my external JavaScript file? I know that people put it at the end of the
body tag to make the web page look like it loads faster. But is there any cons about
putting it at the end?
And would this be a good
practice to put the JavaScript with the Google Analytics
code?
//
Everything else over here ... conent etc..
type="text/javascript">
type="text/javascript">
// google analytics code
Answer
Yes people usually put it at the end for
faster page loads. What you have there with the google analytics script is common
practice.
You might also want to check out href="http://headjs.com/" rel="noreferrer">head.js - this href="http://headjs.com/#theory" rel="noreferrer">has been shown to be even
faster than a single script put at the end of the body
No comments:
Post a Comment