History 对象中包含用户(在浏览器窗口中)访问过的URL

History 对象是window对象的一部分,可通过window.history属性对其进行访问。

注释:没有应用于History对象的公开标准,不过所有浏览器都支持该对象。

History对象属性

length 返回浏览器历史列表中的URL数量。

History对象方法

back()加载history列表中的前一个URL

forward()加载history列表中的下一个URL

go()加载history列表中的某个具体页面

History对象描述

History对象最初设置来表示窗口的浏览器历史。但出于隐私方面的原因,History对象不再允许脚本访问已经访问过的实际url。唯一保持使用的功能只有back、forward()、和go()方法。

例子

下面一行代码执行的操作与单击后退按钮的操作一样;

history.back();

下面一行代码执行的操作与单击两次后退按钮执行的操作一样

history.go(-2);

Browser History的更多相关文章

  1. [React] Keep Application State in Sync with Browser History

    Using pushState and passing route data via context allows our application to respond to route change ...

  2. react服务端渲染同构报错Browser history needs a DOM

    https://github.com/nozzle/react-static/issues/343 去掉了browserRouter就不报错了,但是又会有其他报错..

  3. 【LeetCode】1472. 设计浏览器历史记录 Design Browser History (Python)

    作者: 负雪明烛 id: fuxuemingzhu 个人博客:http://fuxuemingzhu.cn/ 目录 题目描述 题目大意 解题方法 模拟法 日期 题目地址:https://leetcod ...

  4. Explain in detail the steps/processes that occur from the moment you type a URL in a browser and hit enter

    In an extremely rough and simplified sketch, assuming the simplest possible HTTP request, no proxies ...

  5. backbone.Router History源码笔记

    Backbone.History和Backbone.Router history和router都是控制路由的,做一个单页应用,要控制前进后退,就可以用到他们了. History类用于监听URL的变化, ...

  6. 使用ajax和history.pushState无刷新改变页面URL(转)

    表现 如果你使用chrome或者firefox等浏览器访问本博客.github.com.plus.google.com等网站时,细心的你会发现页面之间的点击是通过ajax异步请求的,同时页面的URL发 ...

  7. history对象 back() forward() go() 和pushState() replaceState()

    History(Window.history对象)对象保存着用户上网的历史记录.处于安全方面的考虑,开发人员无法得知用户浏览过的URL,但是借由用户访问过的页面列表,同样可以在不知道实际URL的情况下 ...

  8. react-router 中的history(react中关于后退键的处理用的到)

    react-router 中的history react-router 是建立在history之上的:我们来谈谈这个history吧. github: mjackson/history history ...

  9. 浅析列表页请求优化(history API)

    最近搞了下列表页请求的功能,并做了一下调研整理,记此文备忘. 列表页请求的功能到处可见,比如在博客园. 点击相应的页码,页面返回相应的内容,看上去似乎大同小异,但是一些小的细节还是可以区分优劣. fu ...

随机推荐

  1. Material使用05 MdListModule模块 MdButtonToggleModule模块

    1 在共享模块中导入MdListModule模块 import { NgModule } from '@angular/core'; import { CommonModule } from '@an ...

  2. Maven的pom实例

    该pom中包含了一些我认为会需要的东西,并且加了注释.可以根据需求适当删减. 包含了spring-mvc , junit,hibernate验证,json,apache-commons组件 还有 co ...

  3. AngularJs(Part 6)

    Overcomming same-origin policy restrictions with JSONP. AJAX has a restriction that it can only retr ...

  4. Learning Python 012 函数式编程 1 高阶函数

    Python 函数式编程 1 高阶函数 高阶函数 Q:什么是高阶函数? A:一个函数接收另一个函数作为参数,这种函数就称之为高阶函数. 简单举个例子: def add(x, y, f): return ...

  5. 28、cd-hit去除冗余序列

    转载:http://blog.sina.com.cn/s/blog_670445240101nidy.html 网址:http://cd-hit.org :http://www.bioinformat ...

  6. 6.6 安装IDEA

    非常感谢Kevin指导.让我简化了安装步骤.安装包可以直接到我的公司文件夹中sunny文件夹中获取. 首先准备好安装包: 然后打开终端: 解压,进入bin目录,执行idea.sh;或者,直接运行: b ...

  7. Python短小精悍的Orator基本使用技巧

    基本使用 配置 设置数据库配置参数,创建一个DatabaseManager实例. from orator import DatabaseManager config = { 'mysql': { 'd ...

  8. HDU - 5542 The Battle of Chibi(LIS+树状数组优化)

    The Battle of Chibi Cao Cao made up a big army and was going to invade the whole South China. Yu Zho ...

  9. struts2知识点汇总

    标签遍历Map<key,List<Object>> listMap=new HashMap<String,List<Student>>(); List& ...

  10. Vue 学习文档

    Vue 学习文档 vue 起步 引包 启动 new Vue(options) options: el 目的地(可以用类名.标签名等,也可以直接用mod元素) #elementId .elementCl ...