zoukankan      html  css  js  c++  java
  • 【前端开发】前端引入公共部分footer header的几种方法,及iframe自适应高度js

    一、引入页面几种方法
     
    1.IFrame引入,看看下面的代码 
     
    <iframe   frameborder=0   border=0   width=300   height=300   src="b.htm" mce_src="b.htm"></iframe> 
    这种高度需要限制是个问题,但经过我不懈努力终于找到了iframe自适应高度方法:
    <iframe name="lanrentuku" src="http://www.lanrentuku.com/" frameborder=false scrolling="auto" width="100%" height="100%" frameborder=no onload="document.all['lanrentuku'].style.height=lanrentuku.document.body.scrollHeight" ></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>
     
    4.使用JQuery的load方法吧!
    <div class="top"></div>
    <div class="footer"></div>
     
    $(document).ready(function(){ 
    $(".top").load("top.html"); 
    $(".footer").load("footer.html"); 
    }); 
     
    这里本人用的最多的则是load  iframe 这两种;
     

  • 相关阅读:
    Java中的内存分配机制
    javac程序的内存分配
    Linux/Ubuntu下解压命令
    Java跨平台原理
    Java数据类型中String、Integer、int相互间的转换
    Maven的安装、配置及使用入门
    Eclipse快捷键大全(转载)
    shell编程基础
    ubuntu 安装source insight
    ubuntu samba
  • 原文地址:https://www.cnblogs.com/xiaohuizhang/p/8880559.html
Copyright © 2011-2022 走看看