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>


  • 相关阅读:
    Win10下Anaconda命令行相关操作
    【问题解决】module 'cv2.cv2' has no attribute 'face'
    LeetCode 53. 最大子序和
    从尾到头打印链表
    字符串逆序
    交换俩字符串
    LeetCode 147. 对链表进行插入排序
    LeetCode 面试题 02.08. 环路检测
    LeetCode 92. 反转链表 II
    LeetCode 143. 重排链表
  • 原文地址:https://www.cnblogs.com/scottckt/p/2281916.html
Copyright © 2011-2022 走看看