from http://www.planabc.net/2009/09/22/iframe_onload/
var iframe = document.createElement("iframe");
iframe.src = "http://www.planabc.net"; if (iframe.attachEvent){ // for ie
iframe.attachEvent("onload", function(){
alert("Local iframe is now loaded.");
});
} else {
iframe.onload = function(){
alert("Local iframe is now loaded.");
};
} document.body.appendChild(iframe);
IE 支持 iframe 的 onload 事件,不过是隐形的,需要通过 attachEvent 来注册。