1.jquery load()方法
$("#footer").load("footer.html")
2.ssi服务
<!- #include virtual="html/footer.shtml" -> shtml格式
3.IFrame引入,看看下面的代码
[代码] <IFRAME NAME="content_frame" width=100% height=30 marginwidth=0 marginheight=0 SRC="import.htm" ></IFRAME>
##说明:样式脱离文档流,样式不易维护
4.<object>方式
[代码] <object style="border:0px" type="text/x-scriptlet" data="import.htm" width=100% height=30></object>
##模板样式不能外部CSS控制
5.document write
var urls = document.getElementsByTagName("script");
var urls = urls[urls.length-1].src;
var url = urls.slice(urls.indexOf("?")+1);
var ieid = url.replace(/\W/m,"_");
document.write(‘<IE:Download ID="‘+ieid+‘" STYLE="behavior:url(#default#download)" />‘);
document.getElementById(ieid).startDownload(url,onDownloadDone);
function onDownloadDone(downDate){
document.write(downDate);
}
html文件代码:
<script src="this.js?lib/top.html"></script>
6.angualr框架ng-include指令