title: Serializing a JSON object to send via AJAX
body: <p>I'm trying to send some data in a JSobject via AJAX using jQuery.</p>
  
  <p>Here's the json object.</p>
  
  <pre><code>var cookieData = {
          'land' : document.URL,
          'ref' : document.referrer
      };
  </code></pre>
  
  <p>The object is them stored in a cookie... via <code>JSON.stringify(cookieData);</code></p>
  
  <p>Before the form is sent and AJAX post is made, I need to get the object's properties:</p>
  
  <pre><code>var cookieData = cookie.get(website); //return the cookieData in stringified form.
  var submitData = 'tracking=' +cookieData + jQuery("#quoteForm").serialize();
  </code></pre>
  
  <p>However, on the receiving application's end, the data is unusable, is there any way that I can serialize it for use in an AJAX post?</p>
  
  <p>The receiving end is a PHP application, processed with:</p>
  
  <pre><code>$trackingData = json_decode(htmlspecialchars_decode($_POST['tracking']),true);
  </code></pre>