title: Using jQuery .post function in a wordpress custom template form
body: <p>I'm currently whipping up a custom contact form on a wordpress site which I'm trying to submit via ajax with jQuery, however when I perform the $.post function, firebug is reporting a 404 error in the console even though I can type the URL in to my address bar and display the page correctly. I am not posting cross-domain.</p>
  
  <p>Here is an example of my code, with irrelevant code removed:</p>
  
  <pre><code>&lt;form action="" method="post" onsubmit="return submitContactForm()" class="contactform"&gt;
   &lt;!-- inputs etc here --&gt;
  &lt;/form&gt;
  
  &lt;script type="text/javascript"&gt;
  function submitContactForm() {
    // Omitted error checking here, return false on error
    $.post('/contact'/, $('.contactform').serialize(), function(data) {
      alert(data);
      return false;
    });
    return true;
  }
  &lt;/script&gt;
  </code></pre>
  
  <p>The post is never successful and the form submits the "normal" way every time.</p>
  
  <p>I've tried many combinations in the url part of $.post including /contact/ , /contact , contact , /contact/, even the full url of the site with no luck. Has anybody had this issue before? Or am I doing something blatantly wrong? My only guess is something to do with my /%postname%/ permalink structure, other than that I'm clueless!</p>
  
  <p>Any ideas/thoughts appreciated</p>
  
  <p>Thanks, Andy</p>