• 周日. 5月 26th, 2024

5G编程聚合网

5G时代下一个聚合的编程学习网

热门标签

iframe框架加载完成后执行函数

admin

11月 28, 2021
var iframe = document.createElement("iframe");
iframe.src = "http://www.baidu.com/";

if (!/*@cc_on!@*/0) { //if not IE
    iframe.onload = function(){
        alert("框架加载完毕.");
    };
} else {
    iframe.onreadystatechange = function(){
        if (iframe.readyState == "complete"){
            alert("框架加载完毕.");
        }
    };
}

document.body.appendChild(iframe);

//方法二
var iframe = document.createElement("iframe");
iframe.src = "http://www.baidu.com/";

if (iframe.attachEvent){
    iframe.attachEvent("onload", function(){
        alert("Local iframe is now loaded.");
    });
} else {
    iframe.onload = function(){
        alert("Local iframe is now loaded.");
    };
}

document.body.appendChild(iframe);

参考网站:https://www.cnblogs.com/supe/p/7345078.html

《iframe框架加载完成后执行函数》有2个想法
  1. Wow, marvelous blog format! How lengthy have you ever been blogging for?
    you made running a blog glance easy. The entire look of your web
    site is magnificent, let alone the content material!
    You can see similar here najlepszy sklep

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注