Simple example for including common files in HTML. JQuery load() function is used for including common HTML files in multiple pages. An example for this is added here.

 1 <html>
 2 <head>
 3 <title>Include Common Files</title>
 4 <script src=”//code.jquery.com/jquery-min.js”></script>
 5 </head>
 6 <body>
 7 <div id=”header”></div><br />
 8 <div id=”content”>
 9 Main Content
10 </div><br />
11 <div id=”footer”></div>
12 <script>
13 $(“#header”).load(“header.html”);
14 $(“#footer”).load(“footer.html”);
15 </script>
16 </body>
17 </html>

 

 

相关文章:

  • 2022-12-23
  • 2021-12-31
  • 2022-12-23
  • 2022-12-23
  • 2022-01-17
  • 2021-12-09
  • 2021-10-08
  • 2022-12-23
猜你喜欢
  • 2021-07-23
  • 2022-12-23
  • 2022-01-23
  • 2021-08-30
  • 2021-11-25
  • 2021-12-12
  • 2022-01-21
相关资源
相似解决方案