在S2SH项目中,我要实现a.jsp中用javascript到action中的一个方法传递值增加一条数据,之后在跳到一个action还是返回a.jsp,页面还是原数据,并没有刷新,但是数据已经插入了,解决a.jsp重新加载一次是在document.location.href=""; 的后面再增添一句window.location.reload();就可以刷新当前页面了。
这是找的资料:
1 history.go(0)
2 location.reload()
3 location=location
4 location.assign(location)
5 document.execCommand('Refresh')
6 window.navigate(location)
7 location.replace(location)
8 document.URL=location.href
这几个都可以刷新
window.location.reload();刷新
window.location.href=window.location.href;刷新
window.close();关闭窗口,不弹出系统提示,直接关闭
window.close()相当于self属性是当前窗口
window.parent.close()是parent属性是当前窗口或框架的框架组
页面实现跳转的九种方法实例:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>navigate</title>
<script language="javascript">
</script>
</head>
<body>
页面将在2秒后跳转
</body>
</html>
解释:
location是个对象,比如本页的document.location和window.location的属性有
本文介绍了使用JavaScript进行页面刷新的不同方法,包括window.location.reload()等,并提供了多种页面跳转的示例代码。
694

被折叠的 条评论
为什么被折叠?



