title: Can't enable CORS in Chrome
body: <p><strong>NOTICE:</strong> This works in <strong>Firefox</strong> but in <strong>Chrome</strong> not working. Why? What I miss?</p>
  
  <p>When I try to run edit function in form it should get data via AngularJS.</p>
  
  <pre><code>var i;
  var url = window.location.href;
  var param = url.split("?");
      param = param[param.length - 1];
  
  var jsonUrl = "http://api.hiremein.rs/?" + param;
  
  $(".update-book").click(function(){
      i = $( this ).data('key');
  });
  var rest = angular.module('rest', []);
  rest.controller('restCtrl', function($scope, $http) {
      $(".update-book").click(function(){
          setTimeout(function(){
          $http.get(jsonUrl, function(req, res){
              res.header("Access-Control-Allow-Origin", "*");
              res.header("Access-Control-Allow-Origin", "X-Requested-With");
              res.send(
                  {jsonUrl}
              );
          })
              .success(function (response) {
                  $scope.names = response.data[i]; 
              });
          }, 300); 
      });
  });
  </code></pre>
  
  <p>When code is executed I get this error:</p>
  
  <blockquote>
    <p>XMLHttpRequest cannot load <a href="http://api.hiremein.rs/?page=1" rel="nofollow">http://api.hiremein.rs/?page=1</a>. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin '<a href="http://client.hiremein.rs" rel="nofollow">http://client.hiremein.rs</a>' is therefore not allowed access.</p>
  </blockquote>
  
  <p>I also tried to add</p>
  
  <pre><code>header("Access-Control-Allow-Origin: *");
  </code></pre>
  
  <p>to <code>index.php</code> on <strong>client</strong> and also on <strong>API</strong> side.</p>
  
  <p>But error is not gone away. </p>