alphagov/static — pull request #376 by edds (2014-02-28 09:15:09+00:00)
Title: Move all JavaScript to the end of the page

Reasons for moving it to the bottom include:

- that it is considered best practice to put JavaScript at the bottom of the page
- some work I am doing requires `GOVUK.cookie` to be available before we execute `_ga.push(['_trackPageview'])` this moves the tracking code below the inclusion of `govuk_template.js` which has that function in it

As far as I can tell all of our JavaScript is deferred till after domReady anyway by wrapping it in a jQuery call so this doesn't actually have any effects there. The only thing this might effect is how quickly the call to GA is made after page load, but again, as far as I can tell the tracking beacons aren't sent till after domReady.