When you put your JavaScript at the top of the page, the browser will start loading your JS files before the markup, images and text. And since browsers load JavaScript synchronously, nothing else will load while the JavaScript is loading. So there will be a timeframe of a few seconds where the user will see a blank page, while the JavaScript is loading. On the other hand, if you place your JavaScript at the bottom of the page, the user will see the page loading first, and after that the JavaScript will load in the background. So if for example your CSS & HTML takes 5 seconds to load, and your JavaScript takes another 5 seconds, putting our JavaScript on the top of the page will give the user a “perceived” loading time of 10 seconds, and putting it on the bottom will give a “perceived” loading time of 5 seconds.
Releases (6)
Date | Version | Notes |
---|---|---|
2015-06-27 | 0.0.0.6 | Skip moving google-analytics to footer |
2014-09-09 | 0.0.0.5 | Skipping condition |
2014-08-25 | 0.0.0.4 | Added the "disabled on pages" option |
2014-08-08 | 0.0.0.3 | Improved deferjs option |
2014-07-21 | 0.0.0.2 | Be careful using option "Defer js" |
2014-07-20 | 0.0.0.1 | Be careful using option "Defer js" |