title: Loading database content via XMLHttpRequest in Wordpress
body: <p>I have created a new wordpress-template-page.  The idea is, that when I click on a link in my sidebar-div, it should load content from an database in my content-div. On a simple php-page it works, but in combination with my wordpress template-page it doesn't work... </p>
  
  <p>And that's my code: (short version)</p>
  
  <pre><code>&lt;?php // Template Name: Weinkarte
  get_header(); ?&gt;
  
  &lt;div id="container-sidebar"&gt;
       &lt;span id="wineList"&gt;&lt;/span&gt;
  &lt;/div&gt;
  
  &lt;div id="sidebar-right"&gt;
      &lt;li&gt;&lt;a href='#' id='1' onclick='loadWine(this.id)'&gt;Click&lt;/a&gt;&lt;/li&gt;
  &lt;/div&gt;
  
  get_footer();
  
  &lt;script&gt;
  function loadWine(id)
  {
  xmlhttp=new XMLHttpRequest();
  xmlhttp.onreadystatechange=function()
    {
    if (xmlhttp.readyState==4 &amp;&amp; xmlhttp.status==200)
      {
      document.getElementById("wineList").innerHTML=xmlhttp.responseText;
      }
    }
  xmlhttp.open("GET","loadWine.php?landID="+id,true); //I think here is probably the fault
  xmlhttp.send();
  }
  &lt;/script&gt;
  </code></pre>
  
  <p>Thanks for any help! :)</p>