js动态创建link
jquery写法兼容性不错
<script>
var link = document.createElement('link');
$(link).attr('rel','stylesheet');
$(link).attr('type','text/css');
$(link).attr('href','/platform/static/largedata/desktop/css/index.css');
document.getElementsByTagName('head')[0].appendChild(link)
</script>
以下这种写法也可以的
<script>
var link = document.createElement('link');
link.setAttribute('rel','stylesheet');
link.setAttribute('type','text/css');
link.setAttribute('href','/platform/static/largedata/desktop/css/index.css');
document.getElementsByTagName('head')[0].appendChild(link)
</script>