1、采用js方法
創(chuàng)新互聯(lián)是專業(yè)的裕安網(wǎng)站建設(shè)公司,裕安接單;提供成都網(wǎng)站設(shè)計、成都網(wǎng)站建設(shè),網(wǎng)頁設(shè)計,網(wǎng)站設(shè)計,建網(wǎng)站,PHP網(wǎng)站建設(shè)等專業(yè)做網(wǎng)站服務(wù);采用PHP框架,可快速的進(jìn)行裕安網(wǎng)站開發(fā)網(wǎng)頁制作和功能擴(kuò)展;專業(yè)做搜索引擎喜愛的網(wǎng)站,專業(yè)的做網(wǎng)站團(tuán)隊,希望更多企業(yè)前來合作!
<body>
? ? <div id="div"></div>
? ? <script>
? ? ? ? ? document.getElementById("div").innerHTML = '<object type="text/html" data="index.html" width="100%" height="100%"></object>';
? ? </script>
</body>
<body> ? ?<div id="div"></div> ? ?<script> ? ? ? ? ?$("#div").load("index.html"); ? ?</script> </body>
2、采用apache等服務(wù)器,使用include
apache默認(rèn)不支持SSI,可以通過修改配置文件來使其支持
搜索AddType text/html .shtml的位置,打開以下注釋
AddType text/html .shtml
AddOutputFilter INCLUDES .shtml
同時需要找到Options Indexes FollowSymLinks,在其后添上Includes
以上表示支持shtml的include命令,如果還想支持html,則需改為
AddType text/html .shtml .html
AddOutputFilter INCLUDES .shtml .html
使用辦法:
建立A.html文件如下
<!DOCTYPE?html> <html> <head> <meta?charset=utf-8> <title>include</title> </head> <body> ????<!--#include?file="B.html"?--> ?</body> ?</html>
建立B.html文件如下
<div>我是被include包含進(jìn)來的</div>
網(wǎng)頁標(biāo)題:html中靜態(tài)包含公共部分
當(dāng)前鏈接:http://www.rwnh.cn/article46/jisshg.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供外貿(mào)網(wǎng)站建設(shè)、建站公司、域名注冊、軟件開發(fā)、外貿(mào)建站、自適應(yīng)網(wǎng)站
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)