close
文章出處
var iframe = document.createElement("iframe"); iframe.style.width = "265px"; iframe.style.height = "490px"; iframe.style.border = "none"; iframe.src = "http://cnblogs.com/walls"; if(iframe.attachEvent){ //IE iframe.attachEvent("onload", function(){ alert("loaded 1"); }); }else{ iframe.onload = function(){ console.log("loaded 2"); }; }
- IE 支持 iframe 的 onload 事件,不過是隱形的,需要通過 attachEvent 來注冊。
摘自怪飛博客:http://www.planabc.net/2009/09/22/iframe_onload/
![]() |
不含病毒。www.avast.com |
全站熱搜