1 <script type="text/javascript"> 2 var gys=9 3 function getCSSLink() 4 { 5 if (gys==0) 6 display = "1.css"; 7 else 8 //样式表的名称,或者你可以加上路径 9 display = "2.css"; 10 11 var css = '<'; 12 css+='link rel="stylesheet" href='+display+' /'; 13 css+='>'; 14 document.write(css); 15 } 16 window.onload=getCSSLink(); 17 </script>