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

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

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

History 对象属性

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

History 对象方法

results matching ""

    No results matching ""