title: File path for AJAX script (in Wordpress)
body: <p>I use this jquery-ajax script to send email:</p>
  
  <pre><code>    $.ajax({
          url: process.php,    
          type: "POST",
          data: data,        
          cache: false,
      ...
  </code></pre>
  
  <p>in <code>url</code> I call the php file that sends email, but ajax get it only if I specify the full path:</p>
  
  <pre><code>url: "http://www.domain.com/wp-content/themes/site_theme/templates/process.php",
  </code></pre>
  
  <p>but I have to use a syntax like this:</p>
  
  <pre><code>url: "../../templates/process.php",
  </code></pre>
  
  <p>or using a variable to declare in the html header/footer</p>
  
  <p><strong>Html</strong>    </p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
    var urlMail = '&lt;?php bloginfo('template_url'); ?&gt;/templates/process.php';
  &lt;/script&gt;
  </code></pre>
  
  <p><strong>Script</strong></p>
  
  <pre><code>url: "../../templates/process.php",
  </code></pre>
  
  <p>but with both the above cases the browser console retrieves this error:</p>
  
  <pre><code>POST http://www.domain.com/templates/process.php 404 Not Found 1.56s
  </code></pre>
  
  <p>Where am I wrong?</p>