JavaScript history
来源:互联网 发布:外汇手机交易软件 编辑:程序博客网 时间:2024/06/05 06:43
window.history 对象在编写时可不使用 window 这个前缀。
- history.back()
加载历史列表中的上一个 URL,与浏览器点击后退按钮作用相同。等价于history.go(-1)。 - history.forward()
加载历史列表中的下一个 URL,与浏览器点击向前按钮作用相同。等价于history.go(-1)。 - history.go(int n)
加载历史列表中向前数第n个的URL(n为负则向后,想到与back)
测试代码如下
<html> <head> <style type="text/css"> .widgetStyle { width:100px; } </style> <script> function init() { document.getElementById("number").value = -1; } function goHistory() { var n = document.getElementById("number").value; history.go(n); } </script> </head> <body onload="init()"> <button type="button" class="widgetStyle" onclick="javascript:history.forward()">forward</button> <button type="button" class="widgetStyle" onclick="javascript:history.back()">back</button> <div> <input type="number" ime="inactive" class="widgetStyle" id="number"/> <button type="button" class="widgetStyle" onclick="goHistory()">go</button> </div> <button type="button" class="widgetStyle" onclick="javascript:location='http://www.baidu.com'">relocate</button> </body></html>
0 0
- JavaScript history
- Javascript的history对象
- Javascript的history对象
- javascript History 对象介绍
- javascript history对象
- javascript:history.go(-1)
- javascript:history.go(-1)
- JavaScript Window History
- javascript中history对象
- javaScript history对象
- Javascript History对象
- JavaScript:History对象
- JavaScript History对象
- JavaScript history 对象
- Javascript—history
- javaScript 之History
- javascript--history对象
- JavaScript学习-history对象
- 缓存
- Eclipse下Ant自动打包,混淆和签名
- Unity3d_基础之GameObject.activeSelf,.activeInHierarchy,.SetActive的区别和关联
- HTML获取系统当前时间
- 算法第一天--桶排序
- JavaScript history
- Excel转换为DataTable
- 禁用enter 提交
- 结构体
- shell的ps命令参数列表解释说明
- git am, git apply, git format-patch,git diff 用法
- 缓存淘汰算法--LRU算法
- libcurl的编译及使用
- Android 6.0 以上版本提示“检测到屏幕叠加层”的问题,规避方法