如何用腳本指定一個frame的src啊﹖

dingyanping 2003-10-20 02:43:25
我的這個frame的名稱是context,我這樣指定﹕document.frames("context").src="",好象不行﹐應該要怎樣指定才可以呢﹖
...全文
85 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
dingyanping 2003-10-20
  • 打赏
  • 举报
回复
不好意思﹐除了jycjyc同志的完全正確﹐沒有任何錯誤之外﹐其它同志的都有問題﹗
所以... ...
  • 打赏
  • 举报
回复
parent.context.location.href="显示的页面.htm"

更正=>

<a href="#" onclick="parent.context.location.href='显示的页面.htm'">在frame中打开</a>
  • 打赏
  • 举报
回复
在frame中加上id="context"
然后:
parent.context.location.href="显示的页面.htm"
uusong 2003-10-20
  • 打赏
  • 举报
回复
parent.top.context.location.href="test.htm"
longshenwang 2003-10-20
  • 打赏
  • 举报
回复
如果 你的链接不在context 里 用

self.parent.document.frames["context"].location.href="目标页.htm";

如果在

self.location.href="目标页.html";
利而不害 2003-10-20
  • 打赏
  • 举报
回复
这样写
document.frames["context"].location.href="";
hrong 2003-10-20
  • 打赏
  • 举报
回复
你自己有没有试过这段代码? 在 window.open 里指定了打开新网页的window.name 就会在指定的框架里打开该网页. 就象链接里的 target 一样
dingyanping 2003-10-20
  • 打赏
  • 举报
回复
可是我不想彈出一個新窗口啊﹐我只想點一下鏈接後﹐frame裡的內容改變而已﹗
hrong 2003-10-20
  • 打赏
  • 举报
回复
window.open("abc.htm", "context");

87,907

社区成员

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

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