用JS动态生成iframe,内容无法显示
先贴代码
var body = document.body;var iframe = document.createElement("iframe");iframe.id = "one";body.appendChild(iframe);var h = document.createElement("h1");h.innerHTML = "what's the fuck what's the fuckwhat's the fuckwhat's the fuckwhat's the fuckwhat's the fuckwhat's the fuckwhat's the fuckwhat's the fuckwhat's the fuckwhat's the fuckwhat's the fuckwhat's the fuck";alert("1");// var fbody = document.getElementById("one");var fbody1 = iframe.contentWindow.document.body;fbody1.appendChild(h);