HTML页面跳转的方法
来源:互联网 发布:阿里巴巴客户顾问知乎 编辑:程序博客网 时间:2024/06/01 18:05
1、html中使用meta中跳转,通过meta可以设置跳转时间和页面
<head><!--只是刷新不跳转到其他页面 --><meta http-equiv="refresh" content="5"><!--定时转到其他页面 --><meta http-equiv="refresh" content="5;url=index.html"> </head>
2、a标签直接跳转
<a href="http://baidu.com">百度一下</a>
3、通过javascript中实现跳转
// 直接跳转window.location.href='index.html';// 定时跳转setTimeout("javascript:location.href='index.html'", 5000);其实两种方式是类似的,只是有的在javascript中写的跳转,另一种直接从html中写跳转
<button id="load" onclick="window.location.reload('/html/index.html')">跳转</button>4、html跳转上一页的方式
window.history.go(-1);或者window.history.back(-1);
在html中写
<a href=”#” onClick=”JavaScript :history.back(1);”>返回上一页</a><a href=”#” onClick=”javascript :history.Go(-1);”>返回上一页</a>在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>
阅读全文
0 0
- HTML页面跳转的方法
- Html/Jsp常用的页面跳转方法
- HTML页面跳转的5种方法
- HTML页面跳转的5种方法
- HTML页面跳转的5种方法
- HTML页面跳转的5种方法
- HTML页面跳转的5种方法
- Html/Jsp常用的页面跳转方法
- HTML页面跳转的方法总汇
- HTML页面跳转的5种方法
- HTML页面跳转的5种方法
- HTML页面跳转的5种方法
- HTML页面跳转的5种方法
- HTML页面跳转的5种方法
- HTML页面跳转的5种方法
- HTML页面跳转的多种实现方法
- HTML页面跳转的5种方法
- hTML页面跳转的5种方法
- 一致性Hash原理
- Nginx日志切割
- Linux学习笔记:Linux基础命令之一
- javascript中文乱码
- python中一些函数使用(tile,排序,搜索,计数)
- HTML页面跳转的方法
- UVA 11646 Athletics Track
- 无法定位程序输入点_ZdaPvj于动态链接库libstdc++-6.dll上
- AFN利用cookie POST JSON服务器接收不到参数
- PPT控件Spire.Presentation 教程:在VB.NET中将HTML字符串附加到PPT中
- ECShop如何修改*.dwt和*.bli文件
- HDU1202 The calculation of GPA
- Win10离线安装.NET Framework 3.5的方法技巧
- Mybatis的使用mapper传多个参数