title: XMLHttpRequest cannot load. No 'Access-Control-Allow-Origin' header is present. (Apache/jQuery/AJAX)
body: <p>This seems to be a pretty common question on here, and I've through a couple dozen threads on the topic. However, none of the responses have worked for me so far. Basically I have a page with a jQuery/AJAX script that pulls a couple <p> elements from an external (cross-domain) page. </p>
  
  <p>I've tried putting this in my .htaccess file:</p>
  
  <pre><code>Header set Access-Control-Allow-Origin "*"
  </code></pre>
  
  <p>as well as:</p>
  
  <pre><code>&lt;ifModule mod_headers.c&gt;
      Header set Access-Control-Allow-Origin: *
  &lt;/ifModule&gt;  
  </code></pre>
  
  <p>but no luck. My AJAX call is:</p>
  
  <pre><code>$.ajax({
      type: 'GET',
      url: 'url', //I have the actual URL here of course
      cache: false,
      contentType: 'text/plain',
      dataType: 'html',
      crossDomain: true,
      success: function( data ) {
          //doing stuff with data in here
      }, error: function(jqXHR, textStatus, errorThrown) {
          alert('critical error. everything is exploding. abort mission.');
      }
  });
  </code></pre>
  
  <p>Everything works perfectly when I run the page from my desktop, but from the actual hosted server, the console error in Chrome reads:</p>
  
  <pre><code>"XMLHttpRequest cannot load http://external_url.com. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://my_url.com' is therefore not allowed access. 
  </code></pre>
  
  <p>Any ideas? </p>