Created
February 3, 2012 18:03
-
-
Save joedeveloper/1731427 to your computer and use it in GitHub Desktop.
Ancient script loader
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** helper function to dynamically include js */ | |
var js; | |
function include_js(file) { | |
var html_doc = document.getElementsByTagName('head')[0]; | |
js = document.createElement('script'); | |
js.setAttribute('type', 'text/javascript'); | |
js.setAttribute('src', file); | |
html_doc.appendChild(js); | |
js.onreadystatechange = function () { | |
if (js.readyState == 'complete' || js.readyState == 'loaded') { | |
thumbgalleryinit(TGconfig); | |
} | |
}; | |
js.onload = function () { | |
thumbgalleryinit(TGconfig); | |
}; | |
return false; | |
} | |
showTG = function(config){ | |
TGconfig = config; | |
include_js('assets/js/yuiloader-dom-event/yuiloader-dom-event.js'); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment