title: XMLHttpRequest cannot load Origin null is not allowed by Access-Control-Allow-Origin
body: <p>I have a code.html file containing the following code.</p>
  <pre><code>$.ajax({ 
      type: &quot;POST&quot;, 
      datatype: &quot;JSONP&quot;,
      url: &quot;path&quot;,
      success: function(msg){
      var e = document.createElement(&quot;div&quot;);
      e.id = &quot;ads&quot;;
      document.body.appendChild(e);
      $(&quot;#ads&quot;).html(msg);
      }
  });
  </code></pre>
  <p>When I open the code.html file in the browser, it gives an error:</p>
  <pre><code>**&quot;XMLHttpRequest cannot load file://..... Origin null is not allowed by Access-Control-Allow-Origin.&quot;**
  </code></pre>
  <p>What is causing this and what can I do to fix this?</p>