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);

 

相关文章:

  • 2022-01-18
  • 2022-12-23
  • 2021-11-03
  • 2022-12-23
  • 2021-11-29
  • 2021-11-18
  • 2021-11-18
  • 2022-03-01
猜你喜欢
  • 2021-08-04
  • 2021-11-29
  • 2021-11-18
  • 2022-02-15
  • 2022-12-23
相关资源
相似解决方案