location方式跳转
location方式的跳转需要在js中进行调用,通过调用它下面的href属性完成跳转,
window.location.href=“www.tstingmi.com/”: window.location.replace
释义:将地址替换成新url,缓存在历史里,不能通过“前进”和“后 退”来访问已经被替换的URL。
使用方法:
window.location.replace(“www.tstingmi.com”): window.location.reload
释义:强制刷新页面,重新请求。
使用方法:
window.location.reload(“www.tstingmi.com”):
a标签直接跳转
1 |
|
通过javascript中实现跳转
1 2 3 4 5 6 |
|
html跳转上一页的方式
window.history.go(-1);或者window.history.back(-1);
在html中写
1 2 |
|
在javascript中写跳转上一页
1 2 3 4 5 6 7 8 |
|
refresh方式跳转
refresh方式的跳转直接在head的meta标签里面添加就可以了,通过url设置跳转路径。
<metahttp-equiv="refresh"content="3;url=https://www.tstingmi.com">
如果refresh中不指定url,则是本页面刷新。
www.tstingmi.com 提供内容。