gteman

1.Jquery load方式

<body>
<div class="headerpage"></div>
<div>...中间部分...</div>
<div class="footerpage"></div>
<script src="js/jquery/2.0.0/jquery.min.js"></script>
<script>
    $(function(){
        $(".headerpage").load("header.html");
        $(".footerpage").load("footer.html");
    });
</script>
</body>

2.把html转为js引入

<script type="text/javascript" src="header.js"></script>

3.使用iframe

<iframe src="header.html" scrolling="no" frameborder="0" height="100%" id="mainFrame" width="100%"></iframe>

 

分类:

技术点:

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-11-01
  • 2021-07-22
  • 2021-11-13
  • 2021-11-29
  • 2022-12-23
猜你喜欢
  • 2021-12-03
  • 2021-10-18
  • 2021-09-27
  • 2021-10-04
  • 2023-01-13
  • 2022-01-24
  • 2022-12-23
相关资源
相似解决方案