If you are creating a link-based game, I would use AJAX to send your click data to your server, process it and return it to the user without refreshing the page at all.
This will not allow you to navigate the page using JS, and it will also make the game much faster and more enjoyable for users.
source
share