日期:2014-05-17  浏览次数:20601 次

返回上一页并刷新的问题?
<script language='javascript'>alert('回复成功!');window.location.href='javascript:history.go(-2);';</script>
返回了上一页~可是不能刷新~!
怎么搞啦?

------解决方案--------------------
window.location.href='javascript:history.go(-2);是原封不动的退回,当然不会刷新了。
window.location.href='xx.jsp'返回你要回到的页面就可以了。
------解决方案--------------------
go(-2)是返回上上一页吧~~go(-1)是返回上一页
------解决方案--------------------
javascript:history.go跟点浏览器前进后退按钮一样,是从浏览器缓存中调出页面,不会提交到服务器
------解决方案--------------------
探讨
window.location.href='javascript:history.go(-2);是原封不动的退回,当然不会刷新了。
window.location.href='xx.jsp'返回你要回到的页面就可以了。

------解决方案--------------------
<script language='javascript'>alert('回复成功!');window.location.href='javascript:history.go(-2);'; </script> 
//
 改为
<script language='javascript'>alert('回复成功!');window.location.href=window.parent.location.href; </script> 

------解决方案--------------------
<script language='javascript'>alert('回复成功!');window.location.href='javascript:history.go(-2);'; 
window.location.href=window.location.href;//加上这句就刷新了
</script>
------解决方案--------------------
用window.location.href='xx.jsp'这种方法 就OK了
------解决方案--------------------
要实再不行,你就这样
<script language='javascript'>alert('回复成功!');</script>
<%response.sendRedirect("xx.jsp");%>
要还是不行,天哪,等待高手吧,我是没招了。

------解决方案--------------------
window.location.href='javascript:history.go(-2);
能说以下为什么是-2;
如果是-2就
window.location.href=window.parent.parent.location.href;