Including an array of JavaScript source files in your project presents a bit of a dilemma.
Some say that the best practice is to include all of the scripts at the bottom of the page because it prevents the page load from blocking; however, you lose any HTML5 and CSS3 functionality and managing script dependencies become more difficult than it already is.
Head JS attempts to change that.
Generally speaking, Head JS is a JavaScript application that will manage all other scripts in your application.
- The script will load all of your source files in parallel
- Simulates certain CSS3 features out-of-the-box for older browsers
- Allows you to use HTML5 tags in browsers that don’t support HTML5
- Automatically detects the size of the screen to support development with widescreens and mobile screens
- …and a lot more.
This is seriously one of the coolest JavaScript-based projects I’ve seen come in out in a long time. The 8BIT Team is definitely going to be taking advantage of this in a few upcoming projects.
Aaron Fenwick says
Hey Tom! Does Standard Theme use anything like this? If not, how would I go about implementing it on my Standard Theme-blog?
Tom McFarlin says
Head JS is platform agnostic so it can be implemented in a theme.
It get a little more complicated because WordPress has its own script manager (see register and enqueue) so it’s a large task pull it through with every script that’s used.
For those that are used in Standard, you’d really just modify the library function in the Standard Theme framework file.
Shoot us a question in the forum if you’re interested in more detail :).