chris-ELM
5/27/2015 - 7:23 AM

Add js script to head

Add js script to head

function appendScript(pathToScript) {
 var head = document.getElementsByTagName("head")[0];
 var js = document.createElement("script");
 js.type = "text/javascript";
 js.src = pathToScript;
 head.appendChild(js);
}

// eg
appendScript('../scripts/jquery-1.11.0.js');