Skip to content

Instantly share code, notes, and snippets.

@Williammer
Created June 9, 2014 08:57
Show Gist options
  • Select an option

  • Save Williammer/5ccc7530efdd64c53c42 to your computer and use it in GitHub Desktop.

Select an option

Save Williammer/5ccc7530efdd64c53c42 to your computer and use it in GitHub Desktop.
jsPerform.joinJs.js - join all the external javaScript files, and execute them after the core js file is loaded.
var script = document.createElement("script");
script.src = "all_20100426.js";
document.documentElement.firstChild.appendChild(script);
var mod = {
buffer: [];
}
var inline_script = 'some_inline scripts';
//more inline scripts...
mod.buffer.push(inline_script);
//exec
var script = mod.buffer,
i, max = script.length;
for (i = 0; i < max; i += 1) {
script[i]();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment