title: Javascript: Prevent page refresh via Ctrl and R
body: <p>I am trying to prevent page refresh only when user clicks Ctrl with R. </p>
  
  <p>I try with the preventDefault() method as following but it does not work:</p>
  
  <pre><code>function disableCtrlR(s) { if ((s.which || s.keyCode) == 17 &amp;&amp; (s.which || s.keyCode) == 82) s.preventDefault(); };
  $(document).ready(function(){
       $(document).on("keydown", disableCtrlR);
  });
  </code></pre>
  
  <p>Any help on this will be appreciated. Thanks.</p>
  
  <p>PS. I know this is not an ideal solution but this is the only solution for me to solve the bug on my webpage while waiting for the bug to be resolved.</p>