Skip to content

Instantly share code, notes, and snippets.

View learning's full-sized avatar
🏠
Working from home

Schopenlaam learning

🏠
Working from home
View GitHub Profile
@learning
learning / gist:2934507
Created June 15, 2012 03:27
Load Script
var loadScript = function(url, callback){
var d = document,
script = d.createElement('script');
script.type = 'text/javascript';
if(script.readyState){
script.onreadystatechange = function(){
if(script.readyState == 'loaded' || script.readyState == 'complete'){
script.onreadystatechange = null;
callback.call(this);
}