HTML页面跳转的方法大全
html中使用meta中跳转,通过meta可以设置跳转时间和页面
<head><!--只是刷新不跳转到其他页面 --><meta http-equiv="refresh" content="5"><!--定时转到其他页面 --><meta http-equiv="refresh" content="5;url=index.html"> </head>
HTML
a标签直接跳转 点击跳转
<a href="http://www.545141.com">点击跳转</a>
HTML
通过javascript中实现跳转
// 直接跳转window.location.href='index.html';// 定时跳转setTimeout("javascript:location.href='index.html'", 5000);
JavaScript
其实两种方式是类似的,只是有的在javascript中写的跳转,另一种直接从html中写跳转
<button id="load" οnclick="window.location.reload('/html/index.html')">跳转</button>
JavaScript
html跳转上一页的方式
window.history.go(-1);或者window.history.back(-1);
HTML
在html中写
<a href=”#” onClick=”JavaScript :history.back(1);”>返回上一页</a><a href=”#” onClick=”javascript :history.Go(-1);”>返回上一页</a>
HTML
在javascript中写跳转上一页
<div id="btn">按钮</div><script type="text/javascript"> var wrong = document.getElementById('btn'); wrong.onclick = function() { window.history.go(-1);//返回上一页 window.history.back(-1);//返回上一页 }</script>
HTML
文章分类
热门文章
最近发表
文章归档
- 2023年11月 (1)
- 2023年2月 (1)
- 2022年12月 (16)
- 2022年11月 (10)
- 2022年10月 (10)
- 2022年9月 (2)
- 2022年6月 (1)
- 2022年3月 (49)
- 2022年2月 (33)
- 2022年1月 (34)
- 2021年12月 (52)
- 2021年11月 (1)
- 2021年10月 (27)
- 2021年7月 (4)
- 2021年5月 (20)
- 2021年4月 (22)
- 2021年3月 (33)
- 2021年2月 (9)
- 2021年1月 (1)
- 2020年12月 (17)
- 2020年11月 (4)
- 2020年4月 (1)
- 2020年3月 (10)
- 2020年2月 (9)