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 这两种;
     

  • 相关阅读:
    5.对象的简化属性
    7.函数参数默认值
    python中argparse
    VC 6.0 打开文件出错
    【UNIX程序设计教程】 阅读初体验(1)
    引以为鉴ARM开发板连线注意事项
    windows xp宿主机 + Linux 虚拟机 网络配置
    Gcc编译选项分析
    ADS下调试出现的警告信息
    S3C2440串口通讯实现
  • 原文地址:https://www.cnblogs.com/xiaohuizhang/p/8880559.html
Copyright © 2011-2022 走看看