zoukankan      html  css  js  c++  java
  • IFrame网页加载完成事件

    网上别人的写法。

    <html>    
    <head>    
    <script type="text/javascript">
        
    var iframe;     
        
    function load() {     
            iframe 
    = document.getElementById("iframe");     
            iframe. onload 
    = iframe. onreadystatechange = iframeload;      
            iframe.src 
    = "http://www.baidu.com";     
        }     
        
    function iframeload() {     
            
    if (!iframe.readyState || iframe.readyState == "complete") {     
                alert(
    "Local iframe is now loaded.");     
            }     
        }     
    </script>    
    </head>    
    <body onload="load()">    
        <iframe id="iframe"></iframe>    
    </body>    
    </html>   

    我是直接接在Iframe中添加写OnLoad事件,代码如下:

    <script type="text/javascript">
            
    //iframe 加载完成
            var iframeLoaded = function (iframe) {
                
    if (iframe.src.length > 0) {
                    
    if (!iframe.readyState || iframe.readyState == "complete") {
                        HideTopWaitPage();
                    }
                }
            }
    </script>  
    <iframe id='ifmArrpove' frameborder='0' width='100%' height='100%' onload='iframeLoaded(this)'}></iframe>


  • 相关阅读:
    bzoj 1208: [HNOI2004]宠物收养所
    bzoj 1207: [HNOI2004]打鼹鼠
    【NOIP模拟赛】小奇的矩阵
    【NOIP模拟赛】小奇挖矿 2
    Making the Grade POJ
    POJ 3616Milking Time
    [USACO08JAN]电话线Telephone Lines
    Radar Installation POJ
    Warfare And Logistics UVA
    【NOIP2009】最优贸易
  • 原文地址:https://www.cnblogs.com/scottckt/p/2281916.html
Copyright © 2011-2022 走看看