title: How to replace whitespace in jquery to pass to php?
body: <p>I'm trying to make some auto suggest stuff for an app. But i'm having some problems. I wrote this jquery code to detect when there is a change in the input:</p>
  
  <pre><code>   function soletsgo(){
          $('#theinput').keyup(function(){
            value = $('#theinput').val();
            if ( value.length &gt; 2 ){
              word = $('#theinput').val();
              word.replace(/\s/g, "&amp;nbsp");
              $("#autodatathing").load("../pages/searchy.php?word="+word+"");
          } else {
  
          }  });  }
  </code></pre>
  
  <p>And there is a PHP file (searchy.php) that processes some stuff:</p>
  
  <pre><code>&lt;?php
  $now = htmlentities($_GET['word']);
  
  echo "&lt;p&gt;";
  echo $now;
  echo "&lt;/p&gt;";
  ?&gt;
  </code></pre>
  
  <p>But, when i put in a 'space' (known as 'whitespace') in the 'input', there is no result!
  Could someone help?</p>