Skip to content

Instantly share code, notes, and snippets.

@dey-dey
dey-dey / gist:2559720
Created April 30, 2012 16:20 — forked from zhannes/gist:2344834
load a script
var loadScript = function(url,callback,async){
if(!url){ return false; }
var script = document.createElement('script'),
head = document.getElementsByTagName('head')[0];
script.src = url;
script.async = async ? true : false;
/* bind a callback for all browsers */