Hi All,
I want to disable browser refresh using javascript. Actually i am using window.onbeforeonload abd i don't want it will be called when user refresh the browser. what is the best way to do it?
Regards,
Salil Gaikwad
Hi All,
I want to disable browser refresh using javascript. Actually i am using window.onbeforeonload abd i don't want it will be called when user refresh the browser. what is the best way to do it?
Regards,
Salil Gaikwad
From the site Enrique posted:
window.history.forward(1);
document.attachEvent("onkeydown", my_onkeydown_handler);
function my_onkeydown_handler() {
switch (event.keyCode) {
case 116 : // 'F5'
event.returnValue = false;
event.keyCode = 0;
window.status = "We have disabled F5";
break;
}
}
You have a design flaw with your page, consider adding a "Refresh..." button to the page instead, or have it dynamically updating like stackoverflow.com does.
From the site Enrique posted:
only works for IE.
try this link http://www.openjs.com/scripts/events/keyboard_shortcuts/