Page history - back button exists?

前端 未结 5 1201
遇见更好的自我
遇见更好的自我 2020-12-09 18:28

Is it possible check if there is a value for history.go(-1)? I know you can\'t access history.previous directly.

I am trying to stay away from document.referrer beca

5条回答
  •  余生分开走
    2020-12-09 18:49

    If the history has a length greater than 0, then it contains at least one history point.

    if (history.length)
    

提交回复
热议问题