判断iframe是否加载完成

var iframe = document.createElement("iframe");
iframe.src = "http://www.jinyon.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);
如果您觉得我的文章有帮助,请随意赞赏!

*发表评论

用QQ账号登录  请登录后发表评论