怎样用JS动态改变frame框架里一个子frame的src 急!!

vaon_1126 2009-05-15 11:04:32
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>123</title>
</head>

<frameset rows="80,*" cols="*" frameborder="no" border="0" framespacing="0">
<frame src="top.html" name="topFrame" scrolling="No" noresize="noresize" id="topFrame" title="topFrame" />
<frameset cols="45%,*" frameborder="no" border="0" framespacing="0">
<frame src="left.html" name="leftFrame" scrolling="AUTO" noresize="noresize" id="leftFrame" title="leftFrame" />
<frameset rows="10%,*" cols="*" frameborder="1" border="1" framespacing="0">
<frame src="right_top.html" name="right_topFrame" id="right_topFrame" title="right_topFrame" />
<frame src="" name="right_bottomFrame" id="right_bottomFrame" title="right_bottomFrame" />
</frameset>
</frameset>
</frameset>
<noframes><body>
</body>
</noframes></html>
我应该怎么用JS实现动态改变right_bottomFrame的src?
功能描述:在right_topFrame中创建一个下拉列表,选择不同的值,就在right_bottomFrame显示不同的网页,这些都是纯html,请各位高手帮帮忙!
...全文
3950 13 打赏 收藏 转发到动态 举报
写回复
用AI写文章
13 条回复
切换为时间正序
请发表友善的回复…
发表回复
monkeycrazy 2012-10-17
  • 打赏
  • 举报
回复
关注
我在页面里混搭了javascript和VBscript,使用这个功能的时候经常混乱
liguo9860 2010-10-22
  • 打赏
  • 举报
回复
忽忽,刚刚我也遇到这个问题了。 幸亏找到这帖子。。。谢谢各位大虾,也谢谢LZ。
gengchenhui 2010-09-01
  • 打赏
  • 举报
回复
用2楼的可以
vaon_1126 2009-05-18
  • 打赏
  • 举报
回复
我现在发现,我某些事情想复杂了。。!一句代码解决了所有的问题。。。
谢谢各位了!
perfectshi 2009-05-17
  • 打赏
  • 举报
回复
[Quote=引用 6 楼 vaon_1126 的回复:]
我郁闷。。现在发现了个问题。。在这框架页面中调用不了JS。。。怎么在这个页面加载的时候调用这个页面的JS函数呢???
[/Quote]

frameset 标签支持onload事件

body 标签支持onload事件
vaon_1126 2009-05-17
  • 打赏
  • 举报
回复
没人来帮我解决吗?高手们,出来帮帮忙。。
redhat2 2009-05-16
  • 打赏
  • 举报
回复
关注

.


人力资源
Dream_gril 2009-05-15
  • 打赏
  • 举报
回复
window.parent.document.getElementById("right_bottomFrame").src="xxx.htm";
gengzhw 2009-05-15
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 hookee 的回复:]
top.right_bottomFrame.location.href = "xxxx.htm";
[/Quote]
如果外面没有嵌套页,这样可以;
如果还有嵌套页:
parent.right_bottomFrame.location.href = "xxxx.htm";
shenzhenNBA 2009-05-15
  • 打赏
  • 举报
回复
建议给 frame 增加 id="" ID属性,然后如下:

document.getElementById("对应的ID号").src="path/xxxx.htm"
hookee 2009-05-15
  • 打赏
  • 举报
回复
top.right_bottomFrame.location.href = "xxxx.htm";
vaon_1126 2009-05-15
  • 打赏
  • 举报
回复
我郁闷。。现在发现了个问题。。在这框架页面中调用不了JS。。。怎么在这个页面加载的时候调用这个页面的JS函数呢???
vaon_1126 2009-05-15
  • 打赏
  • 举报
回复
这些都是写在该框架页面的<script></script>里面吗?
我现在改了,准备在另外一个页面的下拉列表传值转到这个框架页面来,要动态改变链接地址。也就是下拉列表选择的项不同,right_bottomframe显示的网页就不同
请各位再帮忙看看!

87,903

社区成员

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

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