title: Handling 'ctrl+s' keypress event for browser
body: <p>I was trying to implement the <kbd>CTRL</kbd>+<kbd>S</kbd> feature for a browser based application. I made a search and came across two scripts in the following to questions</p>
  <p><a href="https://stackoverflow.com/questions/93695/best-cross-browser-method-to-capture-ctrls-with-jquery">Best cross-browser method to capture CTRL+S with JQuery?</a><br/>
  <a href="https://stackoverflow.com/questions/11000826/ctrls-preventdefault-in-chrome">Ctrl+S preventDefault in Chrome</a></p>
  <p>However, when I tried to implement it, it worked but, I still get the default browser save <strong>dialog box/window</strong>.</p>
  <p>My Code:For <code>shortcut.js</code>:</p>
  <pre class="lang-js prettyprint-override"><code> shortcut.add(&quot;Ctrl+S&quot;,function() {
       alert(&quot;Hi there!&quot;);
   },
   {
       'type':'keydown',
       'propagate':false,
       'target':document
  });
  </code></pre>
  <p>jQuery hotkeys.js:</p>
  <pre class="lang-js prettyprint-override"><code>$(document).bind('keydown', 'ctrl+s', function(e) {
      e.preventDefault();
      alert('Ctrl+S');
      return false;
  });
  </code></pre>
  <p>I believe <code>e.preventDefault();</code> should do the trick, but for some reason it doesn't work. Where am I going wrong.Sorry if it is simple, still learning jJvascript.</p>