关于刷新框架的问

iranjn 2008-05-12 04:15:54
有一个框架结构
<frameset rows="50%,50%" cols="*" framespacing="1" frameborder="yes" border="1" cellpadding="1" cellspacing="0" borderColorDark="#ffffff" borderColorLight="#000000">
<frame src="a.jsp?p= <%=p%>" name="mainFrame">
<frame src="b.jsp?p= <%=p%>&type=1" name="topFrame" >

</frameset>
b.jsp提交成功后想同时刷新a.jsp
成功以后b.jsp是下面的代码
1、out.print("<script language=javaScript>\n<!--\n");
2、out.print("alert(\"成功!\")\n");
3、out.print("location.replace(\"??\")\n");
4、out.print("//-->\n</script>\n");

第三行的??处应该写什么代码才能实现刷新a.jsp
...全文
168 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
xtzhoujie 2008-05-14
  • 打赏
  • 举报
回复
直接out.println("this.parenter.mainFrame.src=a.jsp;");
xtzhoujie 2008-05-14
  • 打赏
  • 举报
回复
直接out.println("this.parenter.list.src=a.jsp?p="+p.trim()+";");
iranjn 2008-05-14
  • 打赏
  • 举报
回复
好像不行呀
out.print("location.replace(\"this.parenter.list.src=a.jsp?p="+p.trim()+"\")\n");
报错呀,还有别的答案吗
KKK2007 2008-05-12
  • 打赏
  • 举报
回复
top.mainframe.location.href=href
sunguochao840828 2008-05-12
  • 打赏
  • 举报
回复
windows.parent.frames.frames的名字.reload()
iranjn 2008-05-12
  • 打赏
  • 举报
回复
好像不行呀
out.print("location.replace(\"this.parenter.list.src=a.jsp?p="+p.trim()+"\")\n");
报错呀,还有别的答案吗
yuanjun_xf 2008-05-12
  • 打赏
  • 举报
回复
[Quote=引用 2 楼 chenjunxt 的回复:]
this.parenter.mainFrame.src=a.jsp
[/Quote]
chenjunxt 2008-05-12
  • 打赏
  • 举报
回复
this.parenter.mainFrame.src=a.jsp
jiaping108 2008-05-12
  • 打赏
  • 举报
回复
为什么要写到这里,你可以把刷新a的动作写到b的onsubmit的JS中去哈

81,091

社区成员

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

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