title: How to format data for XDomainRequest
body: <p>I need to post data to a cross origin web service using json.  This works perfectly in ie10+ but not in ie8/9.</p>
  
  <p>After researching i discovered i need to use XDomainRequest but am unsure how to format the data.</p>
  
  <p>For example, can i just wrap a string around my JSON object and send it or does it need to be in name value pairs like?</p>
  
  <p>Im currently sending</p>
  
  <pre><code>{
  "field": {
      "field": "blah",
      "field": "blah",
      "field": "blah",
      "field": "blah",
      "field": [
          "ML08BWV",
          "MJ08OJF",
          "MJ10PYO",
          "FT10EXZ",
          "SH57XUM"    
      ]}
  }
  </code></pre>
  
  <p>I'm definitely hitting the server but the server logs suggest that im not sending any data in the request payload. :/</p>
  
  <p>Edit: Javascript Code</p>
  
  <pre><code>        var xdr = new XDomainRequest(); // Use Microsoft XDR
          xdr.open('POST', URL);
          xdr.onload = function () {
              //xdr.contentType = "application/json";
              var dom = new ActiveXObject('Microsoft.XMLDOM'), JSON = $.parseJSON(xdr.responseText);
  
              dom.async = false;
  
              if (JSON == null || typeof (JSON) == 'undefined') {
                  JSON = $.parseJSON(data.firstChild.textContent);
              }
  
              //Do something with json
          };
  
          xdr.onerror = function () {
              _result = false;
          };
  
          xdr.ontimeout = function () {
              alert('xdr ontimeout');
          };
          xdr.onprogress = function () {
              alert("XDR onprogress");
              alert("Got: " + xdr.responseText);
          };
  
  
          xdr.send("json=" + dataToSend); 
  </code></pre>
  
  <p>dataToSend is in the json format as posted above       </p>