…….φ(..)メモメモです。 document.createElement(‘iframe’) で作った DOM 要素に onload をセットする場合以下のようなコードを使います。 var iframe = document.createElement('iframe'); var onload_func = function() { // onload で実行する処理 } if (document.all && !window.opera) { // IE の場合 onreadystatechange が必要 iframe.onreadystatechange = function() { if (iframe.readyState == "complete") { onload_func(); } } } else { // IE 以外なら onload で良い iframe.on
![クロスブラウザでdocument.createElement(‘iframe’)した要素のonloadを呼び出す方法](https://cdn-ak-scissors.b.st-hatena.com/image/square/cdc2a6fcbb07d858cf841199197a8633cecee9f1/height=288;version=1;width=512/http%3A%2F%2Fsakuratan.biz%2Fblog%2Fwp-content%2Fplugins%2Fwp-ogp%2Fdefault.jpg)