tangteng78
asked on
How to prevent refresh using Javascript?
Hi,
How do i prevent a user from refreshing (hitting F5 or reload button) on the browser, using a javascript?
PS: I have a javascript math game that i do not want the user to refresh, as it will reload/reset the whole game all over again.
How do i prevent a user from refreshing (hitting F5 or reload button) on the browser, using a javascript?
PS: I have a javascript math game that i do not want the user to refresh, as it will reload/reset the whole game all over again.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks guys. Let me try all of the solutions above. Will get back to you guys. Appreciate the help.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
<body onbeforeunload="return 'you will restart the game'">