title: simple javascript AJAX post function not working
body: <p>Hi I want to send data to the server and then have the php file save it.
  But currently I can't get even a simple POST to work.</p>
  
  <p>This is the javascript and html part:
  This function is declared in the head:</p>
  
  <pre><code>function sendTableToServer(){
      var xhttp;
      if (window.XMLHttpRequest){
          xhttp=new XMLHttpRequest();
      } else {
          xhttp=new ActiveXObject("Microsoft.XMLHTTP");
      }
  
      xhttp.open("POST","http://music.collwyncraig.info/hajimama/save_setlist.php",true);
      xhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
      xhttp.send("fsong=AbandonSeoul");
  }
  </code></pre>
  
  <p>Then this html is in the body:</p>
  
  <pre><code>&lt;button type="button" onclick="sendTableToServer()"&gt;Save Setlist&lt;/button&gt;
  </code></pre>
  
  <p>This is the php file</p>
  
  <pre><code>&lt;?php
  if (isset($_POST["fsong"])){
      echo 'trying';
      $song = $_POST["fsong"]; 
      echo $song;
      echo 'ok';
  }
  ?&gt;
  </code></pre>
  
  <p>When I click the button, nothing happens.
  If I use a <code>&lt;form&gt;</code> and a submit button, the php file is loaded by the browser, and I can access the input.  However, I want to use a function like this because the information I want to send is going to be taken out of the html page using javascript and HTML DOM.
  So, why doesn't anything happen? :)</p>