title: Access-Control-Allow-Origin - Error when trying to access JSON from Wordpress installation
body: <p>I try to access my blog using the "old" Json-Api from JavaScript (AngularJS)</p>
  
  <p>Now I receive the following error:</p>
  
  <blockquote>
    <p>XMLHttpRequest cannot load
    <a href="http://example.com/?json=get_category_index" rel="nofollow">http://example.com/?json=get_category_index</a>. No
    'Access-Control-Allow-Origin' header is present on the requested
    resource. Origin '<a href="http://localhost:63342" rel="nofollow">http://localhost:63342</a>' is therefore not allowed
    access.</p>
  </blockquote>
  
  <p>Looks like a simple thing. But even after I tried the following:</p>
  
  <p>Add these lines into the .htaccess:</p>
  
  <pre><code>Header add Access-Control-Allow-Origin "*"
  Header add Access-Control-Allow-Headers "origin, x-requested-with, content-type"
  Header add Access-Control-Allow-Methods "PUT, GET, POST, DELETE, OPTIONS"
  </code></pre>
  
  <p>Add the following line to the themes' header.php and to json-api.php:</p>
  
  <pre><code>&lt;? header("Access-Control-Allow-Origin: *"); ?&gt;
  </code></pre>
  
  <p>I still get this error.</p>