• 【前端开发】前端引入公共部分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 这两种;
     

  • 相关阅读:
    OpenIOC
    网站舆情监测
    乌云的背后是阳光
    2014 十大工具
    NetFlow网络流量监测技术的应用和设计(转载)
    免费工具
    Oracle RAC环境下怎样更新patch(Rolling Patch)
    Answer&#39;s Question about pointer
    cocos2d-x 3.0 final 移植 android
    ReactNavtive框架教程(3)
  • 原文地址:https://www.cnblogs.com/xiaohuizhang/p/8880559.html
Copyright © 2020-2023  润新知