title: Posting null values via AJAX
body: <p>Using the jQuery <code>$.post</code> function, if you send a <code>null</code> value, it arrives at the server side as <code>"null"</code>. Example:</p>
  
  <p>Javascript:</p>
  
  <pre><code>$.post('test.php', { foo : null });
  </code></pre>
  
  <p>PHP:</p>
  
  <pre><code>var_dump($_POST['foo']); // string(4) "null"
  </code></pre>
  
  <p>I understand why this is so, but was wondering the best way to work around the limitation? Should you:</p>
  
  <ol>
  <li>Loop through all the variables in JS before you send them and replace with an empty string?</li>
  <li>Interpret <code>"null"</code> as <code>null</code> on the server side?</li>
  <li>Don't send the variable at all?</li>
  <li>Something else?</li>
  </ol>