JS:动态加载js&动态加载css

/* Impot Common script*/    function addJS(jsfile)    {        var head = document.getElementsByTagName('HEAD').item(0);        var script = document.createElement('SCRIPT');        script.src = jsfile;        script.type = "text/javascript";        head.appendChild(script);    }     function addCSS(cssfile) {         var head = document.getElementsByTagName('HEAD').item(0);        var style = document.createElement('link');        style.href = cssfile;        style.rel = 'stylesheet'        style.type = 'text/css';        head.appendChild(style);    } /* LoadScripts at here.*/     function LoadScripts()    {        addJS(_ResourcePath+"Scripts/ToolBar.js");    }     function LoadCSS()    {        addCSS(_ResourcePath+"Styles/default.css");    }
posted @ 2010-03-31 12:37  xiaozhang  阅读(355)  评论(0编辑  收藏  举报