Skip to content

Instantly share code, notes, and snippets.

@cbfranca
Created April 28, 2014 18:10
Show Gist options
  • Save cbfranca/11379638 to your computer and use it in GitHub Desktop.
Save cbfranca/11379638 to your computer and use it in GitHub Desktop.
Module("Everest.ClickTrade.LoadScript", function (LoadScript) {
LoadScript.fn.initialize = function (url, async) {
this.url = url;
this.async = typeof async !== 'undefined' ? async : false;
this.loadScript(url);
};
LoadScript.fn.loadScript = function () {
var script = document.createElement('script');
var scripts = document.getElementById("load-scripts");
script.type = 'text/javascript';
script.async = this.async;
script.src = this.url;
scripts.parentElement.insertBefore(script, scripts);
};
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment