Skip to content

Instantly share code, notes, and snippets.

@joedeveloper
Created February 3, 2012 18:03
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save joedeveloper/1731427 to your computer and use it in GitHub Desktop.
Ancient script loader
/** 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