靜態(tài)頁(yè)面中想包含其他頁(yè)面,使用<!--#include file="文件名"-->的方式已經(jīng)不行了,那么如果的確想實(shí)現(xiàn)包含就得想點(diǎn)其他方法了,本文就給出了6種方法。
(1)使用IFrame
這個(gè)可能是大家最熟悉的
<IFRAME NAME="neepage" width=100% height=30 marginwidth=0 marginheight=0 SRC="http://www.survivalescaperooms.com/article/netsite/list7-1.html"></IFRAME>
加上它的一些屬性可以實(shí)現(xiàn)一些透明,無(wú)滾動(dòng)條等具體的效果。
(2)使用Frameset
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>包含頁(yè)面</title>
</head>
<frameset framespacing="0" frameborder="NO" border="0">
<frame src="http://www.survivalescaperooms.com/article/netsite/list7-1.html" name="mainFrame">
</frameset>
<noframes><body></body></noframes>
</html>
這就是大家熟悉的框架了
(3)使用<object>
個(gè)人覺(jué)得此法方便比較好
<object type="text/x-scriptlet" data="http://www.survivalescaperooms.com/article/netsite/list7-1.html" width=100% height=30></object>
(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('http://www.survivalescaperooms.com/article/netsite/list7-1.html',onDownloadDone)
</script>
(5)使用<script>
就是把相關(guān)的html文件轉(zhuǎn)化為js文件.再在調(diào)用的時(shí)候用
<script src="import.js"></script>
這個(gè)方法有點(diǎn)要注意的
假如你是用來(lái)包含象頭部,導(dǎo)航這些的話(huà),建議不要用這個(gè).不利于搜索引擎的搜集
(6)HTML中執(zhí)行SSL
存在這種情況,主機(jī)只默認(rèn)的是index.html,但是需要首頁(yè)是動(dòng)態(tài)的,除了上述方法,可以使用SSL
[!--#exec cgi="index.pl" --]
新聞熱點(diǎn)
疑難解答