Can we get browser history by using Javascript?

后端 未结 3 1631
死守一世寂寞
死守一世寂寞 2020-12-06 01:10

Can we get browser history for my site with Javascript ?

I can see some of old posts and threads talking about that... but those approaches didn\'t work for me.

3条回答
  •  自闭症患者
    2020-12-06 01:36

    You can make use of History object of javascript to do that

    The history property has the return value as history object, which is an array of history items having details of the URL's visited from within that window. Also, note that the History object is a JavaScript object and not an HTML DOM object.

    syntax of history property of Window Object:

    window.history 
    

提交回复
热议问题