次のコードで iframe の contentDocument と contentWindow にアクセスしようとしています。しかし、どちらもヌルです。
var iframe = document.createElement('iframe');
this.get__domElement$i().appendChild(iframe);
if (iframe.contentDocument) {
iframe.contentDocument.write("Hello");
}
else if (iframe.contentWindow) {
iframe.contentWindow.document.body.innerHTML = "Hello";
}
誰かがこれで何が悪いのか教えてもらえますか? ありがとう
Document.Body.AppendChild(iframe) を実行すると、contentDocument と contentWindow は null ではありません。
iframe を div に追加すると何が問題なのか誰か教えてもらえますか?
どうもありがとう。