JavaScript动态创建Link标签

var head = document.getElementsByTagName("head")[0];
var link = document.createElement("link");
link.setAttribute("href","http://www.yaohaixiao.com/wp-content/themes/BlueNight/style.css");
link.setAttribute("rel","stylesheet");
link.setAttribute("type","text/css");
head.insertBefore(link,head.firstChild);