Let's say that someone decides to press F5 or the browser's reload button. Is that possible to open a specific url in the same tab?
相关问题
- Is there a limit to how many levels you can nest i
- How to toggle on Order in ReactJS
- How to fix IE ClearType + jQuery opacity problem i
- void before promise syntax
- jQuery add and remove delay
Like posted in comment, if you display prompt, this is possible using following ugly hack:
As noted in this Stack Overflow answer, the ShortCut library is designed to handle keyboard button events, including F-keys and arrow-buttons etc.
However, I must say that the idea of redirecting people to another page or site when they think they are refreshing the page is not only bad practice, but open to abuse.
Use This