zoukankan      html  css  js  c++  java
  • 在html文件引入其它html文件的几种方式

    在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="文件名称"-->

  • 相关阅读:
    memset使用技巧
    04.碰撞反应
    03.键盘状态跟踪与精灵删除
    02.基本动作
    01.基本图形
    00.入门
    03.交互--鼠标,键盘
    02.action--新增精灵知识点
    01.helloworld--标签
    05.声音
  • 原文地址:https://www.cnblogs.com/cmblogs/p/4088721.html
Copyright © 2011-2022 走看看