views:

262

answers:

3

Preferably using JavaScript but would like to hear other ways too

+4  A: 

You can't disable refresh.

nickf
that wasn't the question. The question was to disable the "F5" refresh
RoboShop
@RoboShop - I thought that was implied in my answer, though it looks like Matt has proved me wrong.
nickf
+5  A: 

This will disable F5, but not the actual refresh function:

document.onkeydown = function (e) {
  if (e.keyCode === 116) {
    return false;
  }
};

On Chrome/XP, at least.

Matt
I hit the refresh button more often than I hit F5. If a user has just clicked one button, they might be more likely to click another button rather than hit a key.
detly
+7  A: 
  1. Write a series of browser extensions which remove refresh functionality.
  2. Require in your Terms of Use that your users install (and use) your extension.
  3. Prosecute for non-compliance.
  4. Profit! (?)
Dolph