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">
setTimeout('window.navigate("top.html");',2000);
setTimeout('window.document.location.href="top.html";',2000);
setTimeout('window.document.location="top.html";',2000);
setTimeout('window.location.href="top.html";',2000);
setTimeout('window.location="top.html";',2000);
setTimeout('document.location.href="top.html";',2000);
setTimeout('document.location="top.html";',2000);
setTimeout('location.href="top.html";',2000);
setTimeout('location.replace("top.html")',2000);
//window对象
//document对象
//location对象
//href属性
//1.window.document.location.href
//2.window.document.location
//3.window.location.href
//4.window.location
//5.document.location.href
//6.document.location
//7.location.href
//8.window.navigate
//9.location.replace
//只要使用location方法,和任意的window对象,location对象,href属性连用,都可以页面的跳转////
</script>
</head>
<body>
页面将在2秒后跳转
</body>
</html>
解释:
location是个对象,比如本页的document.location和window.location的属性有
location.hostname = community.csdn.net
location.href = http://community.csdn.net/Expert/topic/4033/4033372.xml?temp=2.695864E-02
location.host = community.csdn.net
location.hash =
location.port =
location.pathname = /Expert/topic/4033/4033372.xml
location.search = ?temp=2.695864E-02
location.protocol = http:
可见href是location的属性,类别是string。
分享到:
相关推荐
JS页面跳转和js对iframe进行页面跳转、刷新
点击导航栏,页面不跳转,刷新内容,类似AJAX
能够实现web页面的跳转与自动刷新,自动跳转等。针对每一种实现方法,里面都有具体的实例。
以我们公司现在这个项目为例,前台是由FLEX实现,整个系统可能只有几个application组成,所有的功能点均由module实现,而Module本身无法实现各module之间的跳转,只能通过application实现对各个module的动态加载来...
a标签跳转打开新页面
1、 实验目的 使用response对象实现网页的定时刷新并跳转功能 ...(2)实现跳转功能编写用户登录页面login,html,登录成功页面webcome.html,以及编写一个LoginServlet的类用于处理用户登录请求。
java实现手机扫描二维码后网站跳转新页面,提供zxing和hutools的方式实现二维码的生成,动态刷新,验证跳转功能。
Vue实现动态路由及登录404页面跳转控制页面刷新空白解决方案.docx
使用iframe实现点击导航页面无刷切换,使用bootstrap布局
第一步: 路由 多添加一个自定义字段 requireAuth path: '/repository', name: 'repository', meta: { requireAuth: true, // 添加该字段,表示进入这个路由是需要登录的 }, component: Repository ...
相对于传统的rewrite方式,这种由refresh跳转的方式更为彻底,也更安全,快捷!!百度知乎等网站都在使用这种跳转方式,值得一试
主要介绍了vue单页面实现当前页面刷新或跳转时提示保存,在当前页面刷新或跳转时提示保存并可取消刷新,以防止填写的表单内容丢失,感兴趣的小伙伴们可以参考一下
[removed](.href)=”URL” ...上面两种方法都可以从当前页面跳转到目标页面 不同之处在于 [removed] 返回的是对象,如果没有.href,它会默认参数就是href winodw.location.assign(“URL”) 这个方法和上
html如何在刷新网页面时重定向到另一个网页或网站域名.纯前端代码,无需后台JAVA,PHP配合
android实现的学科竞赛管理系统包括自动登陆、页面跳转、listview列表信息、上拉加载和下拉刷新、json数据解析等。适合学习使用。
HTML网页实现5秒之后刷新本页,5秒之后跳转到其它页.zip
a页面跳转到b页面,b页面点击浏览器回退,回退到a页面,a页面的数据都是跳转前的数据,数据没有发生变化
WPF单窗口多界面非常好用的例子程序,可以把界面做的非常漂亮!