iframe的操作??这段代码错在哪呀?
海天候 2003-04-02 12:08:59 <body>
<p>
<input type="button" name="Button" value="清除frm1的内容" onclick="viewsource()">
</p>
<p>
<input type="button" name="Submit2" value="把Frm2的内容给Frm1" onclick="frm1tofrm2()">
</p>
<p>frm1</p>
<p>
<iframe width="100" height="100" src="" name="frm1"></iframe>
</p>
frm2
<p>
<iframe width="100" height="100" name="fasdfasfd" src=""></iframe>
</p>
</body>
</html>
<script language="JavaScript">
getvalue();
//查看frm1的源代码
function viewsource()
{
var i;
if (window.parent.frames!=null) {
for (i=0; i<window.frames.length; i++)
window.alert("Child window "+i+" is named "+window.frames(i).name);
}
}
function getvalue()
{
fasdfasfd.location.href="http://www.cctv.com"
}
</script>
出错提示:
行:33
字符:9
错误:拒绝访问
代码:0
昏了。。