var iframe = document.createElement("iframe");
iframe.src = "http://www.google.com.hk";
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);
判断 iframe 是否加载完成的完美方法
最新推荐文章于 2020-09-18 20:28:01 发布