天天看點

包含Html檔案的幾種方法

< DOCTYPE html PUBLIC -WCDTD XHTML StrictEN httpwwwworgTRxhtmlDTDxhtml-strictdtd>

.IFrame

這個可能是大家最熟悉的.

<IFRAME NAME="neepage" width=100% height=30 marginwidth=0 marginheight=0 SRC="import.htm" ></IFRAME>

加上它的一些屬性可以實作一些透明,無滾動條等具體的效果.大家可以參考html語言的相關介紹

2.Frameset

這就是大家熟悉的架構了

沒什麼好說的.看看相關的html就行

3.<object>

<object type="text/x-scriptlet" data="import.htm" width=100% height=30></object>

<object id=editBox data="./" width="100%" height=500 type=text/x-scriptlet>

4.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>

5.<script>

就是把相關的html檔案轉化為js檔案.再在調用的時候用

<script src="import.js"></script>

這個方法有點要注意的

假如你是用來包含象頭部,導航這些的話,建議不要用這個.不利于搜尋引擎的搜集

6.shtml

用include shtml檔案的方式

本文轉自 netcorner 部落格園部落格,原文連結:http://www.cnblogs.com/netcorner/archive/2007/04/23/2912384.html  ,如需轉載請自行聯系原作者

繼續閱讀