title: XMLHttpRequest cannot load http://example.com/test.php. No 'Access-Control-Allow-Origin
body: <p><code>XMLHttpRequest</code> cannot load <code>http://example.com/test.php.</code> No <code>Access-Control-Allow-Origin</code> header is present on the requested resource. Origin <code>http://eample.com</code> is therefore not allowed access.</p>
  
  <p>How to resolve it. i added following headers in that php file:</p>
  
  <pre><code>header('Access-Control-Allow-Origin: *');
  
  header('Access-Control-Allow-Methods: GET, POST, OPTIONS');
  
  header('Access-Control-Allow-Headers: Origin, Content-Type, Accept, 
  Authorization, X-Request-With');
  
  header('Access-Control-Allow-Credentials: true');
  </code></pre>
  
  <p>i replace my domain name 'codeXXX' with 'example' dont confuse with that</p>