headjs/headjs — pull request #252 by cybercandyman (2013-07-25 07:53:56+00:00)
Title: api.ready priority

I want to share my update about method "api.ready" that takes an additional argument called 'priority' (not required). With this new argument you can organize each initialization with a given priority; for example

head.ready(function() {
console.log("to do in the middle");
},5);
head.ready(function() {
console.log("to do last");
},10);
head.ready(function() {
console.log("to do first");
},-1);
head.ready(function() {
console.log("priority not fixed, set to 0");
});