Loading

iframe加载完成事件

var iframe = document.createElement("iframe");
iframe.src = "http://www.jb51.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);
posted @ 2018-03-26 15:24  算了个球  阅读(2941)  评论(0编辑  收藏  举报