1

I need to do following steps before using history.go

  1. I need to read the recent histories for my page
  2. if history matches with the link specified by me then it should open link
  3. or else it should alert some warning

Please help to fix this issue

David
  • 15,894
  • 22
  • 55
  • 66
user3016320
  • 49
  • 1
  • 3
  • 6

2 Answers2

0

In general javascript cannot read the browser history directly. There is a workaround for this issue desribed here.

For the described requirement I would recommend to use cookies.

trylimits
  • 2,575
  • 1
  • 22
  • 32
0

Read this https://developer.mozilla.org/en-US/docs/Web/Guide/API/DOM/Manipulating_the_browser_history

you can manipulate the browser history using window object.

use history api I think you may complete using this.

see the demo of history api

I hope it will help full to you.

CJ Ramki
  • 2,620
  • 3
  • 25
  • 47