您的位置:首页 > Web前端 > HTML

在html文件引入其它html文件的几种方式

2014-11-11 09:38 246 查看
在html文件引入其它html文件的几种方式

简介:

1.IFrame引入,瞧一下下面的代码

[代码] <IFRAME NAME="content_frame" width=100% height=30 marginwidth=0 marginheight=0 SRC="import.htm" ></IFRAME>

2.<object>方法

[代码] <object style="border:0px" type="text/x-scriptlet" data="import.htm" width=100% height=30></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>

纯静态页面只能用上边三种了

如果是动态页面就好办了,可以用include

<!--#include file="test1.asp"-->

如果服务器支持ssi可以用ssi

<!--#include virtual="文件名称"-->

<!--#include file="文件名称"-->
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: