title: How do I setup simple firebase ajax request?
body: <p>I know I can use set to hit Firebase, but I want to use AJAX instead so I tried the below code. When I load test.html in my browser, the console says -</p>
  
  <p><strong>XMLHttpRequest cannot load <a href="https://jleiphonebook.firebaseio.com/json" rel="nofollow">https://jleiphonebook.firebaseio.com/json</a>. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access. The response had HTTP status code 405.</strong></p>
  
  <p>//text.html</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
    &lt;head&gt;
      &lt;meta charset="utf-8"&gt;
      &lt;title&gt;Firebase Test&lt;/title&gt;
      &lt;script src='https://cdn.firebase.com/js/client/2.2.1/firebase.js'&gt;&lt;/script&gt;
    &lt;/head&gt;
    &lt;body&gt;
      &lt;div id="hi"&gt;&lt;/div&gt;
      &lt;script   src="https://code.jquery.com/jquery-1.12.2.min.js"   integrity="sha256-lZFHibXzMHo3GGeehn1hudTAP3Sc0uKXBXAzHX1sjtk="   crossorigin="anonymous"&gt;&lt;/script&gt;
      &lt;script&gt;
        $(document).ready(function () {
          var param = {lastName: "Doe", firstName: "John"};
          $.ajax({
            url: 'https://jleiphonebook.firebaseio.com/json',
            type: "POST",
            data: param,
            success: function () {
              alert("success");
            }
          });
        });
      &lt;/script&gt;
    &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>//firebase rules</p>
  
  <pre><code>{
      "rules": {
          ".read": true,
          ".write": true
      }
  }
  </code></pre>