title: Why does adding "return false;" to a submit event prevent the page from refreshing?
body: <p>I'm doing a tutorial on making a chat server with Node.js and socket.io. Here's what I had  in the html:</p>
  
  <pre><code>&lt;form id='chat_form'&gt;
    &lt;input id='chat_input' /&gt;
    &lt;button&gt;Send&lt;/button&gt;
  &lt;/form&gt;
  &lt;script type='text/javascript'&gt;
  var socket = io();
  $('#chat_form').submit(function(){
    var message = $('#chat_input').val();
    socket.emit('messages', message);
    $('#chat_input').val('');
  });
  &lt;/script&gt;
  </code></pre>
  
  <p>I won't bother putting what I had on the back-end, because that part all worked fine. But in the browser, every time I submitted, the page refreshed, and a <code>/?</code> was added to the end of the URL bar.</p>
  
  <p>Looked around for a bit, and found another tutorial (the one on the socket.io website), that had basically the same code, but they had added <code>return false;</code> to the end of their submit event. Tried that out and it worked fine. I'd like to understand why that worked though. Can anyone explain? Also, can you explain why the <code>/?</code> was added to the URL?</p>