js动态插入link标签

1
2
3
4
5
6
7
8
var includeCss = function(url) {
var link = document.createElement("link");
link.rel = "stylesheet";
link.type = "text/css";
link.href = url;
document.getElementsByTagName("head")[0].appendChild(link)
};
includeCss("./css/Mdate.css");