1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 2 <html xmlns="http://www.w3.org/1999/xhtml">
 3 <head>
 4     <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
 5     <title></title>
 6     <script type="text/javascript" src="test5.js"></script>
 7 </head>
 8 <body>
 9     
10 </body>
11 </html>
 1 function loadStyles(url) {
 2     var link = document.createElement("link");
 3     link.rel = "stylesheet";
 4     link.type = "text/css";
 5     link.href = url;
 6     var head = document.getElementsByTagName("head")[0];
 7     head.appendChild(link);
 8 }
 9 
10 loadStyles("styles.css");

相关文章:

  • 2022-12-23
  • 2021-12-26
  • 2021-11-26
  • 2022-12-23
  • 2021-10-13
  • 2021-11-25
  • 2021-06-27
  • 2022-12-23
猜你喜欢
  • 2021-07-01
  • 2022-12-23
  • 2022-12-23
  • 2021-06-23
  • 2021-12-12
  • 2021-10-08
  • 2022-12-23
相关资源
相似解决方案