[removed] detect when page has been navigated “back” to

后端 未结 2 1956
忘掉有多难
忘掉有多难 2021-01-18 07:19

Suppose I have a page open in a browser and I go to my address bar and enter another page. Then I hit the back button to go to my original page. I\'d like to write some Java

相关标签:
2条回答
  • 2021-01-18 07:46

    You should try to give the user a cookie on both pages, the navigated to page and the page itself, with dates and times and compare see if they're close, or if they show that he's been on one page, been on another, and then redirected.

    Another option is to give the user a cookie when he is redirected

    0 讨论(0)
  • 2021-01-18 08:03

    In Firefox, you can check for the DomContentLoaded event. For a cross-browser solution, a little more work is required:

    http://dean.edwards.name/weblog/2005/09/busted/

    0 讨论(0)
提交回复
热议问题