title: jquery.post not passing data to php file
body: <p>I am having trouble getting the jquery.post method to pass a variable to a php file. 
  I can print the variable to a div using javascript okay but when I pass it to the php file it will only return the fallback value I have put in.
  Can you suggest why it might not be working?</p>
  
  <pre><code>&lt;script type="text/javascript" src="../jquery.min.js"&gt;&lt;/script&gt;
  
  &lt;script type="text/javascript"&gt;
  function vwidth(){
      var vwWidth = window.innerWidth;
      document.getElementById('printVar').innerHTML = vwWidth; //test js variable - ok
      $.post( "listGen.php", {vwWid: vwWidth});
  }
  &lt;/script&gt;
  
  &lt;body onLoad="vwidth()" onResize="vwidth()"&gt;
  &lt;div id="printVar"&gt;
  &lt;/div&gt;
  &lt;div&gt;
  &lt;?php 
      include 'listGen.php';
      echo $viewwidth; 
  ?&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>listGen.php -</p>
  
  <pre><code>&lt;?php
      if (isset($_POST['vwWid'])){
          $viewwidth = $_POST['vwWid'];
          }
          else {
          $viewwidth = 1200;
          }
  ?&gt;
  </code></pre>