这是02页:
iframe_content.php
Some content is here.
iframe.php
<iframe id="sumon_iframe" src="iframe_content.php"></iframe>
<script language="JavaScript" type="text/javascript">
var iframe_id=document.getElementsByTagName('iframe')[0].id; //i get it perfectly
var content=iframe_id.body.innerHTML; //i don't get value
alert(content);
</script>
如何使用Javascript在iframe.php页面中获取iframe
innerHTML
(Some content is here
)?
答案 0 :(得分:0)
你必须使用
iframe.contentDocument
或
iframe.contentWindow
for ie