Questions tagged [head.js]

Head.js is a tiny script that speeds up, simplifies and modernizes your site.

From headjs.com:

A tiny script that speeds up, simplifies and modernizes your site.

Head.js loads your scripts separately so that your page will request your script files individually and is non blocking. Usually the user's browser will request them all when it retrieves the page.

60 questions
29
votes
5 answers

Are there any drawbacks to using head.js?

Things I am aware of: Screen flicker if scripts alter styles / content (not an issue for me as I currently load scripts at the end of the page and so have workarounds already) Inability to detect script load failure (not too concerned about this…
Stuart Burrows
  • 10,824
  • 2
  • 34
  • 33
10
votes
1 answer

Is it possible to make Head JS's ready() function wait for two scripts?

I load three scripts on my webpage, and I would like to trigger a function once two of them has finished loading. head.js( { webfont: 'http://ajax.googleapis.com/ajax/libs/webfont/1.0.31/webfont.js' }, { jquery:…
Jan Aagaard
  • 10,940
  • 8
  • 45
  • 80
6
votes
1 answer

How to load javascript from a CDN with a local fallback in the

I want to use Head JS to dynamically load all of the other scripts for my pages. I'm planning on using the version hosted by CDNJS to take advantage of the better caching, decreased latency, etc. I have no reason to think CDNJS is going anywhere,…
stevenem
  • 63
  • 1
  • 6
5
votes
0 answers

Does headjs offer any practical performance benefits over traditional JavaScript approaches?

From the information on the headjs website, it looks like loading files in parallel using headjs is the fastest way to load external JS files. It also says that loading JS files on the bottom or top of the page doesn’t make a big difference. It…
Benny Tjia
  • 4,853
  • 10
  • 39
  • 48
5
votes
3 answers

How to use a JavaScript loader like head.js or labjs in Magento

Off the bat Magento comes with more than half a dozen JavaScript libraries which do not help with the already cumbersome load times. Has anybody been able to successfully use a script loader like head.js or labjs with Magento so that they can load…
Matthew Dolman
  • 1,732
  • 7
  • 25
  • 49
4
votes
1 answer

head.ready() vs. $(document).ready

Recently discovered the head.js library and boy am I happy with it, although I'm still a bit confused about one thing. From headjs.com: The “DOM ready” event such as $(document).ready() is already fired when the scripts arrive. If the loaded…
dougmacklin
  • 2,560
  • 10
  • 42
  • 69
4
votes
3 answers

jQuery + head.js: How to trigger $(document).ready() manually from inside ready callback of head.js?

I need to optimize the load time of a web application which contains lots of javascript files included in each of it's HTML pages. I want to try head.js in one such page to see if it improves load time. There are lots of $(document).ready(callback)…
craftsman
  • 15,133
  • 17
  • 70
  • 86
3
votes
1 answer

pubnub and head.js

Has anyone managed to integrate pubnub and head.js properly? Pubnub expect me to put their script at the bottom of the page with a
tag just before it. This ensures that the ` tag is completely loaded by the time the javascript is called…
creamcheese
  • 2,524
  • 3
  • 29
  • 55
3
votes
1 answer

html5 cache manifest compatibility with head.js?

There are large speed benefits to using head.js in my own sites. Now I am considering HTML5 cache manifest to improve offline access to sites and improving speed (more things are loaded from cache) Are the benefits of head.js still there (parallel…
iphone dev
  • 31
  • 2
3
votes
1 answer

head.js: weird negative html margin?

Maybe some of you have already some experience with using head.js. I'm a first-time user and I'm having some problems: as soon as I try to load multiple javascript files my tag get a style="margin-left: -32767px;" applied.
matt
  • 42,713
  • 103
  • 264
  • 397
3
votes
0 answers

IE9 and head.js loads script twice

Using Head.js (0.9) and verifying the loading of scripts from IE9, the Network pane of IE9 developer shows that the javascripts are loaded twice. First time, the script is loaded with HTTP result code 200, thereafter the same script is reloaded with…
2
votes
1 answer

head.js and responsive web design

I've been researching responsive web design technologies and head.js and I have a few questions. How much of a realistic reduce in load time head.js have you experienced when lazy loading external js files? How much extra development/effort is…
Evan
  • 5,975
  • 8
  • 34
  • 63
2
votes
2 answers

Many recommended scripts should go at the bottom of the page - does this include Cufon?

All front end developers out there will have heard some experts state that it is best practice to put scripts at the bottom of the page. My question is, does this include Cufon also? (that us, if you are using Cufon of course). As an aside.. I…
swisstony
  • 1,667
  • 3
  • 18
  • 27
2
votes
1 answer

Creating function for head.js gives pretty wild errors in different browsers

I'm building a function for head.js ( http://headjs.com) that will load scripts into it in much the same way as the jQuewy ( http://jquewy.com) library does. However, I'm getting some pretty crazy errors with different browsers. The desired result…
John Hamelink
  • 1,036
  • 2
  • 15
  • 33
2
votes
1 answer

Detecting load failures with head.js

When a required script doesn't load, the callback fires even if the script load fails (404): function callback () { console.log('callback,', arguments); } head.test({ test: 1 === 1, success: ["/non-existant.js"], failure: [], …
Russ Back
  • 903
  • 2
  • 15
  • 27
1
2 3 4