Skip to content

Instantly share code, notes, and snippets.

@sivagao
Created April 2, 2013 09:48
Show Gist options
  • Select an option

  • Save sivagao/5291125 to your computer and use it in GitHub Desktop.

Select an option

Save sivagao/5291125 to your computer and use it in GitHub Desktop.
minimal sequent conditional scripts loader
function(b) {
// extra functions, test, variables here
// it's a closure !
function c() { // k=[]会被滤掉, onload后再次仔细c(), e.shift();
if (d = e.shift()) a = b.body.appendChild(b.createElement("SCRIPT")), a.onload = c, a.src = d
}
var K = [],
e = K.concat(
Object.create ? K : 'es5-sham.js',
K.forEach ? K : 'es5-shim.js',
Function.bind ? K : 'bindOnlyShim.js',
window.JSON ? K : 'json2.js', [ // library list
'lib.js',
'main.js']
),
a, d;
c()
}(document);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment