开发者

inner html of iframe object error

开发者 https://www.devze.com 2023-01-08 13:01 出处:网络
parent.document.getElementById(\"next\").innerHTML=window.frames[\'hiddenframe\'].document.body.innerHTML;

parent.document.getElementById("next").innerHTML=window.frames['hiddenframe'].document.body.innerHTML;

Error: window.frames.hiddenframe is undefined

this is the error i get. i have given an id for iframes as hiddenframe but still it isnt working.

i cant see to find my mist开发者_如何学编程ake please help.


You need to use the contentWindow property.

document.getElementById('hiddenframe').contentWindow.document.body.innerHTML

That will allow you to access the contents of the iframe.

The way you have it at the moment, you would be accessing the frame via the name attribute, not the ID.

0

精彩评论

暂无评论...
验证码 换一张
取 消