title: Cross-subdomain ajax request denied even when document.domain is set correctly
body: <p>In my application I have a website on one sub-domain (dev.u413.com) and I use jQuery to make an ajax request to a JSON api on another sub-domain (api.u413.com). When I inspect the requests in Chrome dev tools and Firefox Firebug it appears my requests are being prevented by the <code>Access-Control-Allowed-Origin</code>. I set <code>document.domain</code> to a suffix of the current domain: <code>document.domain = 'u413.com';</code>.</p>
  
  <p>Here is my request:</p>
  
  <pre><code>    $.ajax({
          dataType: 'json',
          data: { parseAsHtml: true, cli: 'help' },
          url: 'http://api.u413.com/',
          success: function (response) {
              alert(response.Command);
          }
      });
  </code></pre>
  
  <p>If I modify the ajax request to be on the same domain then the request is successful.</p>
  
  <pre><code>    $.ajax({
          dataType: 'json',
          crossDomain: false,
          data: { parseAsHtml: true, cli: 'help' },
          url: 'http://dev.u413.com/',
          success: function (response) {
              alert(response.Command);
          }
      });
  </code></pre>
  
  <p>Why does this happen? The browser shouldn't complain about cross-domain problems since I set <code>document.domain</code> to a common suffix of both sub-domains as per the guidelines on the <a href="https://developer.mozilla.org/en/Same_origin_policy_for_JavaScript" rel="nofollow noreferrer">same origin policy</a>.</p>
  
  <p>I have the app working with jsonp currently but I feel like proper ajax requests should be working as per the same origin policy I linked above. I'd rather not use jsonp if I don't have to. Is it not possible to make regular ajax requests across sub-domains?</p>