Change JS ordering

- Load jQuery before Modernizr so that the fallback method will
always be applied immediately after jQuery. If a script is
enqueued in the footer after jQuery, then the fallback shows up
in the footer. Modernizr will always be in the head so this
issue won't occur.

- Move plugins.js and main.js to footer

jQuery is still kept in the head to avoid conflicts with plugins
This commit is contained in:
Ben Word
2013-02-05 16:10:19 -06:00
parent eb9f9896a4
commit 6354758ad4
2 changed files with 13 additions and 13 deletions

View File

@@ -87,12 +87,12 @@ If you're using LESS, make sure you compile the files to the proper locations:
JavaScript is loaded in the following order:
1. `/theme/assets/js/vendor/modernizr-2.6.2.min.js`
2. `jquery-1.9.0.min.js` via Google CDN with local fallback
3. `/theme/assets/js/plugins.js`
4. `/theme/assets/js/main.js`
1. `jquery-1.9.0.min.js` via Google CDN with local fallback
2. `/theme/assets/js/vendor/modernizr-2.6.2.min.js`
3. `/theme/assets/js/plugins.js` (in footer)
4. `/theme/assets/js/main.js` (in footer)
jQuery is loaded in `head.php` using the same method from HTML5 Boilerplate: grab Google CDN's jQuery, with a protocol relative URL; fall back to local if offline. It's kept in the header instead of footer to avoid conflicts with plugins.
jQuery is loaded using the same method from HTML5 Boilerplate: grab Google CDN's jQuery, with a protocol relative URL; fallback to local if offline. It's kept in the header instead of footer to avoid conflicts with plugins.
`plugins.js` contains a minified version of all the latest Bootstrap plugins.