title: Loading json file from url fails due to access control checks
body: <p>I am trying to load json into a javascript file like so:</p>
  
  <pre><code>$().ready(function () {
        var url = 'url/fname.json';
  
        $.get(url, function (data) {
          // can use 'data' in here...
          console.log(data)
        });
      });
  </code></pre>
  
  <p>However, I get the errors "Origin null is not allowed by Access-Control-Allow-Origin" and "[Error] XMLHttpRequest cannot load  due to access control checks".</p>
  
  <p>Others have suggested adding <code>Access-Control-Allow-Origin: &lt;origin&gt; | *</code> (<a href="https://stackoverflow.com/questions/43517254/safari-10-1-xmlhttprequest-with-query-parameters-cannot-load-due-to-access-cont?rq=1">Safari 10.1: XMLHttpRequest with query parameters cannot load due to access control checks</a>) or <code>header('Access-Control-Allow-Origin: null');</code> (<a href="https://stackoverflow.com/questions/3595515/xmlhttprequest-error-origin-null-is-not-allowed-by-access-control-allow-origin">XmlHttpRequest error: Origin null is not allowed by Access-Control-Allow-Origin</a>), but it's unanswered in those posts where that header goes in an html file. </p>
  
  <p>Is adding this line the solution to my problem? If so, where should I put it?</p>