Html页面当中引入其他的Html文件

1、iframe

<iframe src="html/template1.html" width="100%" height="50" frameborder="0"></iframe>

2、object

<object data="html/template2.html" width="100%" height="50" ></object>

3、.Behavior的download方式

<span id=showImport></span> 
<IE:Download ID="oDownload" STYLE="behavior:url(#default#download)" /> 
<script> 
  function onDownloadDone(downDate){ 
  showImport.innerHTML=downDate 
  } 
  oDownload.startDownload('import.htm',onDownloadDone) 
</script>

 4、也可以使用js动态加载,将Html代码放入js当中,使用document.writeln可以达到像原生代码一样的插入效果

posted @ 2020-04-23 10:52  可达鸭给我冲鸭  阅读(491)  评论(0编辑  收藏  举报