Can I detect when a user gets to a page using the back button?

前端 未结 4 796
無奈伤痛
無奈伤痛 2021-01-11 20:37

Edit: What I really need to know is if there is any javascript event that will reliably fire when the user arrives at the page via the back button. I trie

4条回答
  •  执念已碎
    2021-01-11 21:20

    Isn't that the behaviour you want, so they don't double-submit using the back button?

    Anyway, you could set a cookie on the following page, and detect that on load on the page with the form.

提交回复
热议问题