INCLUDE COMMON FILES IN HTML USING JQUERY

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>

 

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章