简单问题,初学着先谢了

hphull 2004-04-28 04:05:12
我有个frame框架网页,其中
<frameset rows="311,*" framespacing="0" border="0" frameborder="0" id = "work" name = "work">
<frameset cols="465,*">
<frame name="contents" target="_self" src="topleft.htm" scrolling="no">
<frame name="main" id = "main" src="topright.htm" scrolling="no" target="_self">
</frameset>
<frame name="bottom" scrolling="auto" noresize target="contents" src="buttom.htm">
</frameset>

在topright.htm中有一个iframe
现在,我想点击topleft.htm中的按钮使iframe的src改变,该如何做?谢谢
...全文
46 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
xubaogongChina 2004-04-28
  • 打赏
  • 举报
回复
楼主的意思是让topright的内容发生变化,只要把连接的网页的target设置为iframe的名字就可以了!
ttkkyy 2004-04-28
  • 打赏
  • 举报
回复
frames['name'].location.href='test.htm'
ttkkyy 2004-04-28
  • 打赏
  • 举报
回复
parent.window.frames['contents'].location.href='test.htm'
hphull 2004-04-28
  • 打赏
  • 举报
回复
是topright.htm里面的iframe的src改变,而不是topright.htm本身改变,再次请教,谢谢
wanghr100 2004-04-28
  • 打赏
  • 举报
回复
Try..

<input type="button" value="Change"
onclick="top.frames['contents'].location.href='test.htm'">

or

<a href="test.htm" target="contents">Change</a>

87,992

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧