HTML如何实现页面跳转(html跳转到指定页面)

大家好,又见面了,又有小伙伴咨询中站源码网跳转的事。

1、html中使用meta中跳转,通过meta可以设置跳转时间和页面

<head>
    <!--只是刷新不跳转到其他页面 -->
    <meta http-equiv="refresh" content="5">
    <!--定时转到其他页面 -->
    <meta http-equiv="refresh" content="5;url=index.html"> 
</head>

2、通过javascript中实现跳转

1 // 直接跳转
2 window.location.href='index.html';
3 // 定时跳转
4 setTimeout("javascript:location.href='index.html'", 5000);

3、html跳转上一页的方式

window.history.go(-1);或者window.history.back(-1);

1 <script type="text/javascript">
2     var wrong = document.getElementById('btn');
3     wrong.onclick = function() { 
4     window.history.go(-1);//返回上一页
5     window.history.back(-1);//返回上一页
6    }
7 </script>

在html中写

<a href=”#” onClick=”JavaScript :history.back(1);”>返回上一页</a>
<a href=”#” onClick=”javascript :history.Go(-1);”>返回上一页</a>

在Js中网页跳转的写法

1、window.location.href

1 window.location.href="http://www.baidu.com" rel="external nofollow" ; //在原有窗口打开

2.window.navigate方式跳转

1 window.navigate("http://www.baidu.com");

1 function toBooks() {
2     
3     //在原有窗口打开
4     window.location.href = "http://www.baidu.com";
5     //打开新的窗口
6     window.open("http://www.baidu.com");
7 }

直接跳转加参数

<script language="javascript" type="text/javascript">
           window.location.href="login.jsp?backurl=" rel="external nofollow" +window.location.href; 
</script>

收藏 (0) 打赏

感谢您的支持,我会继续努力的!

打开微信/支付宝扫一扫,即可进行扫码打赏哦,分享从这里开始,精彩与您同在
点赞 (0)

免责声明:本文系转载自互联网,版权归原作者所有;旨在传递信息,不代表中站源码网的观点和立场。如有侵权,请联系我们删除!qin@ceccz.com

中站源码网-网络情报局 CMS教程 HTML如何实现页面跳转(html跳转到指定页面) https://web.ceccz.com/cmsjc/4298.html

中站网

常见问题
  • 本站所有资源版权均属于原作者所有,这里所提供资源均只能用于参考学习用,请勿直接商用。若由于商用引起版权纠纷,一切责任均由使用者承担。更多说明请参考 VIP介绍。
查看详情
  • 最常见的情况是下载不完整: 可对比下载完压缩包的与网盘上的容量,若小于网盘提示的容量则是这个原因。这是浏览器下载的bug,建议换浏览器下载!
查看详情

相关文章

评论
暂无评论
官方客服团队

为您解决烦忧 - 24小时在线 专业服务

 
HTML如何实现页面跳转(html跳转到指定页面)-海报

分享本文封面