@importurl(style.
2. 用createElement方法创建CSS的Link标签
下面是经常会用到的两个函数.
functionloadJs(file){
varscriptTag=document.getElementById('loadScript');
varhead=document.getElementsByTagName('head').item(0);
if(scriptTag)head.removeChild(scriptTag);
script=document.createElement('script');
script.src="../js/mi_"+file+".js";
script.type='text/
javascript';
script.id='loadScript';
head.appendChild(script);
}
functionloadCss(file){
varcssTag=document.getElementById('loadCss');
varhead=document.getElementsByTagName('head').item(0);
if(cssTag)head.removeChild(cssTag);
css=document.createElement('link');
css.href="../css/mi_"+file+".css";
css.rel='stylesheet';
css.type='text/css';
css.id='loadCss';
head.appendChild(css);
}