leohxj
1/27/2014 - 7:28 AM

load script in html

load script in html

var oBody = document.getElementsByTagName('body').item(0),
            oHead = document.getElementsByTagName('head').item(0);

            var zeptoScriptTag= document.createElement("script");
            zeptoScriptTag.type = "text/javascript";
            zeptoScriptTag.src="zepto-core.min.js";
            oBody.appendChild(zeptoScriptTag);
            zeptoScriptTag.onload = function (){
                var appScriptTag= document.createElement("script");
                appScriptTag.type = "text/javascript";
                appScriptTag.src="app.js";
                oBody.appendChild(appScriptTag);
            };