html5 怎么在前端跳转到其他页面

如题所述

第1个回答  2017-05-08
<a href="index1.html">点击</a>
点击后跳转到index1.html页面。
第2个回答  2017-05-08
1.定时跳转或者原地刷新
HTML5页面跳转的几种方法
优点:简单
缺点:Struts Tiles中无法使用
对于刷新当前页面js控制为:
window.location.reload(); //刷新当前页面,重新向服务器请求数据
2.js手动跳转
HTML5页面跳转的几种方法
优点:灵活,可以结合更多的其他功能
缺点:受到不同浏览器的影响
上面的方法跳转会保留历史页面记录,通过返回键可以返回上一个界面,如果不像返回,直接替换页面永续i安眠的函数:
window.location.replace("hello.html"); //刷新当前页面,重新向服务器请求数据
3.历史记录跳转
1. window.history.go():
window.history.go(-1); // 返回上一页
window.history.go(-2); // 返回上两页
window.history.go("hello.html"); // 跳转到hello.html
2. window.history.back();等同于:window.history.go(-1); //返回上一页
3. window.history.forward(); // 返回下一页本回答被网友采纳