prevent refresh javascript code example
Example 1: refresh window js
window.location.reload();
Example 2: prevent reload javascript
window.onbeforeunload = function() {
return "Dude, are you sure you want to leave? Think of the kittens!";
}
Example 3: refresh javascript
location.reload();
Works like refresh button.