页面跳转

一,在标签上注册点击事件

<div onclick="window.open('index.heml')">新窗口打开</div>
<div onclick="window.open('index.html','_self')">在当前页面打开</div>

二,a标签跳转

<a href="index.html" target="_blank">新的页面打开</a>
<a href="index.html" target="_self">在当前页面打开</a>

三,js控制

window.location.href="index.html"
window.location.replace('index.html')

刷新页面:


top.location.reload();//刷新顶级页面


parent.location.reload();//刷新父级页面
window.location.reload(true/false)  //刷新当前页面,相当于按了客户端的F5
window.parent.location.reload();//刷新父级页面

  

 

原文地址:https://www.cnblogs.com/duhui/p/12218150.html