用javaScript加载css、js
function addLink(url) {
var link = document.createElement("link");
link.rel = "stylesheet";
link.type = "text/css";
link.href = url;
document.getElementsByTagName("head")[0].appendChild(link);
}
function addScript(url) {
var newscript = document.createElement('script');
newscript.setAttribute('type','text/javascript');
newscript.setAttribute('src',url);
var head = document.getElementsByTagName('head')[0];
head.appendChild(newscript);
}
addScript("js文件链接");
addLink("css文件的链接");
Comment here is closed