HTML如何实现页面跳转(html跳转到指定页面) 您所在的位置:网站首页 html页面内跳转 HTML如何实现页面跳转(html跳转到指定页面)

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

#HTML如何实现页面跳转(html跳转到指定页面)| 来源: 网络整理| 查看: 265

大家好,又见面了,我是你们的朋友全栈君。

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

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 2 var wrong = document.getElementById('btn'); 3 wrong.onclick = function() { 4 window.history.go(-1);//返回上一页 5 window.history.back(-1);//返回上一页 6 } 7

在html中写

返回上一页 返回上一页

在Js中网页跳转的写法

1、window.location.href

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

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 }

直接跳转加参数

window.location.href="login.jsp?backurl="+window.location.href;

发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/128066.html原文链接:https://javaforall.cn



【本文地址】

公司简介

联系我们

今日新闻

    推荐新闻

    专题文章
      CopyRight 2018-2019 实验室设备网 版权所有