프로그램/script

Simple Javascript Injection

mulderu 2013. 10. 5. 06:37


아주 간단한 javascript loader

loadJS = function(jsPath) {

var script = document.createElement('script');

script.type = 'text/javascript';

script.async = true;

if(jsPath.indexOf('http') == 0) script.src = jsPath;

else script.src = "//"+jsPath;

var entry = document.getElementsByTagName('script')[0];

entry.parentNode.insertBefore(script, entry);

}