title: jQuery AJAX Post not posting data
body: <p>Right I have given in, after about 2 hours trying to figure out this issue I've caved, help me out stackoverflow!</p>
  
  <p>Trying to post a product id along with quantity to a php file that will return errors if it finds any</p>
  
  <p>jQuery code - </p>
  
  <pre><code>$('span.add_to_cart').click(function () {
          $('div.cart').append('&lt;span class="loading"&gt;LOADING&lt;/span&gt;');
          $.ajax({
              type: "POST",
              url: "/onlineshop/scripts/add_to_cart.php",
              dataType: "json",
              data: { prod_id: $('input.product_id').val(), 
                      quantity: $('input.quantity').val()
              },
              contentType: "application/json",
              success: function(data) {
                  $('span.loading').remove();
              },
              error: function(xhr, textStatus, thrownError, data) {
                  alert("Error: " + thrownError);
                  $('span.loading').remove();
              }
          })
      });
  </code></pre>
  
  <p>And my PHP page is just trying to <code>print_r($_POST)</code> </p>
  
  <p>It seems that it is not posting my data, I've tried many many different things, all give me the error saying that there is no data being posted.</p>