title: WORDPRESS : Ajax and template
body: <p>I have a question.</p>
  
  <p>How can I use Ajax on my templates... </p>
  
  <p>in <strong>single.php</strong> I have :</p>
  
  <blockquote>
  <pre><code>  $.ajax({
      type: "POST",
      url: "http://www._____wp-content/themes/MS-MangoBerry___/myajax.php",
      data: "yo",
      cache: false,
      success: function(data)
      {
        alert("yes");
      }
    });
  </code></pre>
  </blockquote>
  
  <p>And in <strong>myajax.php</strong>, I have </p>
  
  <blockquote>
    <p></p>
    
    
    $(document).ready(function() {  
    alert("ok"); }); 
    
    <p></p>
  </blockquote>
  
  <p>Then I have an error : <b>Fatal error</b>:  Call to undefined function  get_header() in myajax.php </p>
  
  <p>Why ? </p>
  
  <p>Thanks in advance.</p>