title: Local File Html - XMLHttpRequest: Network Error 0x80070005, Access is denied
body: <p><strong>Edit: Not duplicate, as my problem fails on every browser as mentioned; Edge, Chrome, FF etc.</strong></p>
  
  <p>I have a <strong>html file which will be on the person's machine</strong>, rather than on an http protocol. Note: it is important that it will be an html file on the person's machine.</p>
  
  <p>Within the javascript is:</p>
  
  <pre><code>var dataARR = {
      mydata: "No Data"
  };
  
  var dataJSON = JSON.stringify(dataARR);
  $.support.cors = true;
  $.ajax({
      type: "POST",
      url: "http://www.mywebsite.com/exclude.php",
      async: true,
      cache: false,
      contentType: "application/json; charset=utf-8",
      crossDomain: true, // This needs to be true for other people
      data: { myJson: dataJSON },
  
      success: function (data) {
          var json = eval('(' + data + ')');
      },
      error: function (XMLHttpRequest, textStatus, errorThrown) {
          // Silent error
          var zz = 2;
      }
  });
  </code></pre>
  
  <p>The file on my server <code>http://www.mywebsite.com/exclude.php</code> is basic for testing.</p>
  
  <p>exclude.php</p>
  
  <pre><code>header("Access-Control-Allow-Origin: *"); // To allow cross domain
  $arr = ["181K2", "4V419"];
  echo json_encode($arr);
  </code></pre>
  
  <p>This does not work if the html file on the person's local machine is launched from Edge, Chrome etc.</p>
  
  <p>Edge gives the error <code>XMLHttpRequest: Network Error 0x80070005, Access is denied.</code>.</p>
  
  <p>Chrome gives the error <code>XMLHttpRequest cannot load http://www.mywebsite.com/exclude.php. Request header field Content-Type is not allowed by Access-Control-Allow-Headers in preflight response.</code></p>
  
  <p>Firefox: I am not sure how to find the FF error as I do not debug in FF generally and am unused to the system. However, when I put the breakpoints in I end up in the section <code>error: function (XMLHttpRequest, textStatus, errorThrown) {</code></p>