如何改变IFRAME的内容

用document.frames("id1").src设置iframe的属性,使其显示内容改变。无效。
请问,除了用link、form的提交方式,有别的办法改变iframe的内容吗?我的JS写法有错误吗?
谢谢。
---------------------------------------------------------------

仁则见人,智则风智
1、

1<input onclick="document.all.mxh.location.replace('http://sina.com.cn')" type="button" value="change"/>
1<br/>
1<iframe id="mxh" src="http://colorweb.go.163.com"></iframe>

2、

1<input onclick="document.all.rpl.innerHTML='&lt;iframe id=mxh src=\'http://www.sina.com\'&gt;&lt;/iframe&gt;'" type="button" value="change"/>
1<br/>
1<span id="rpl"><iframe id="mxh" src="http://colorweb.go.163.com"></iframe></span>
Published At
Categories with Web编程
Tagged with
comments powered by Disqus