JS中的history对象
来源:互联网 发布:方舟数据修改 编辑:程序博客网 时间:2024/05/03 08:10
1、history对象记录了用户曾经浏览过的页面(URL),并可以实现浏览器前进与后退相似导航的功能。
语法:
window.history.[属性|方法]
具体操作:
注释:back()、forward()是基于用户浏览记录,浏览缓存的。。。back()等同于点击浏览器的倒退按钮。forward()等同于点击浏览器的前进按钮。
back()相当于go(-1),代码如下:
window.history.go(-1);forward()相当于go(1),代码如下:
window.history.go(1);
代码示例:
<script type="text/javascript"> var HL = window.history.length; document.write(HL);window.history.back();//返回到上一个页面</script>
2、返回浏览历史中的其他页面
go()方法,根据当前所处的页面,加载 history 列表中的某个具体的页面。
window.history.go(number);
0 0
- JS中的history对象
- 【整理】JS中的History对象
- JS History对象
- js历史对象History
- js的History对象
- js之History对象
- js中的history和location对象及节点
- js中的History +
- JavaScript中的History历史对象
- Js:Js对象——History
- window对象中的location、screen、navigator、history
- JS history对象和screen对象以及Navigator对象
- JavaScript基础----35JS浏览器对象-History对象
- history对象
- History 对象
- history对象
- History 对象
- history对象
- 使用Spring MVC构建Web应用程序
- Head First 设计模式(5):单件模式
- Android属性动画-Property Animation(三) 使用ValueAnimator完成动画
- Rest介绍
- SEO的未来发展前景
- JS中的history对象
- Spring MVC 框架搭建及详解
- 文章标题
- ZOJ Problem Set - 1216 Deck
- mac下配置svn服务器详解及用户的权限管理(亲测)
- Unity3D总结:关于射线碰撞
- sourceinsight的字体乱码显示问题解决
- iOS 在imageview中添加按钮 并能响应消息 响应者链条
- Git使用详细教程