right.html还没加载完吧?
<html>
<body>
<iframe id="frm" name="frm" src="http://www.baidu.com"> </iframe>
<input type=button value="Click me to get the codes" onclick=showCodes()>
<script>
function showCodes(){
alert(window.frames["frm"].document.documentElement.innerHTML); }
</script>
</body>
</html>
<html>
<body>
<iframe id="frm" name="frm" src="http://www.baidu.com"> </iframe>
<input type=button value="Click me to get the codes" onclick=showCodes()>
<script>
function showCodes(){
alert(window.frames["frm"].document.documentElement.innerHTML); }
</script>
</body>
</html>
一个是iframe必须加载完后,才能访问里面的内容
1楼的则是跨域访问的问题