title: Google Place API - No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access
body: <p>I am using Google Place API.</p>
  
  <p>What I want to get suggestion of place for type helping.</p>
  
  <p>So, what I have done is-</p>
  
  <pre><code>var Google_Places_API_KEY = "AIzaSyAK08OEC-B2kSyWfSdeCzdIkVnT44bcBwM";      //Get it from - https://code.google.com/apis/console/?noredirect#project:647731786600:access
  var language = "en";        //'en' for English, 'nl' for Nederland's Language
  
  
  var Auto_Complete_Link = "https://maps.googleapis.com/maps/api/place/autocomplete/json?key="+Google_Places_API_KEY+"&amp;types=geocode&amp;language="+language+"&amp;input=Khu";
  $.getJSON(Auto_Complete_Link , function(result)
  {
      $.each(result, function(i, field)
      {
          //$("div").append(field + " ");
          //alert(i + "=="+ field);
          console.error(i + "=="+ field);
      });
  });
  </code></pre>
  
  <p>So in what link I am requesting is -</p>
  
  <blockquote>
    <p><a href="https://maps.googleapis.com/maps/api/place/autocomplete/json?key=AIzaSyAK08OEC-B2kSyWfSdeCzdIkVnT44bcBwM&amp;types=geocode&amp;language=en&amp;input=Khu" rel="noreferrer">https://maps.googleapis.com/maps/api/place/autocomplete/json?key=AIzaSyAK08OEC-B2kSyWfSdeCzdIkVnT44bcBwM&amp;types=geocode&amp;language=en&amp;input=Khu</a></p>
  </blockquote>
  
  <p>And if I go to this link with browser, I can get output like it (please try to ck)-</p>
  
  <p><img src="https://i.stack.imgur.com/reAGm.jpg" alt="11"></p>
  
  <p>But if I try with jQuery's <strong>.getJSON</strong> or <strong>.ajax</strong>, I am getting my request blocked with this message-</p>
  
  <p><img src="https://i.stack.imgur.com/LvinM.jpg" alt="222">.</p>
  
  <p>SO the XMLHTTPRequest is blocked because of - </p>
  
  <blockquote>
    <p>No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access.</p>
  </blockquote>
  
  <p>I have checked in <a href="https://stackoverflow.com/">StackOverflow</a> for this problem solution and go through <a href="https://stackoverflow.com/questions/20518524/no-access-control-allow-origin-header-is-present-on-the-requested-resource-or">here</a> and <a href="https://stackoverflow.com/questions/20035101/no-access-control-allow-origin-header-is-present-on-the-requested-resource">here</a>, but can't get my solution perfectly.</p>
  
  <p>Can anyone please enlighten me?</p>