判断IE中iframe完美加载完毕的方法

转:

var iframe = document.createElement("iframe");

iframe.src = "http://www.planabc.net";

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

或者:

  var iframe = document.getElementById("frm_txt_ParentId");
iframe.src = "dialog/common-mselect.aspx?dialogName=select_customer&selectionMode=1&filter=";
if (iframe.attachEvent) {
//IE
iframe.attachEvent("onload", function () {
alert("111111Local iframe is now loaded.");
});
} else {
//非IE
iframe.onload = function () {
alert("222Local iframe is now loaded.");
};
}
上一篇:IDEA一定要改的八条配置


下一篇:IDEA八条配置修改