title: NetworkError: Failed to execute 'send' on 'XMLHttpRequest'
body: <p>I'm trying to do a POST ajax request to a server hosted locally on my laptop but I can't seem to get any information back. When I click a button on my site (localhost), I can see the server passing back the correct information but on the front end I get this error:</p>
  
  <blockquote>
    <p>error: NetworkError: Failed to execute 'send' on 'XMLHttpRequest': Failed to load '<a href="http://comp-ip" rel="noreferrer">http://comp-ip</a>'.</p>
  </blockquote>
  
  <pre><code>var param = JSON.stringify({varA:"varA",varB:"varB"});
  
  $.ajax({
    type: "POST", 
    url: "http://comp-ip",
    async: false, 
    data: param,
    success: function(result, status, xhr){
      alert(result + ": " + status);
    },
    error: function(xhr, status, err) {
      alert(status + ": " + err);
    }
  });
  </code></pre>
  
  <p>It seems to be triggering an error every time and not 'success'. Anyone have any idea what is wrong?</p>
  
  <p>Edit: I've tried sending a normal POST request without AJAX and it throws me an 'undefined' error as well:</p>
  
  <pre><code>$(document).ready(function(){
      var param = JSON.stringify({varA:"varA",varB:"varB"});
       $("#btn").click(function(event){
             $.post( 
                "http://ip",
                 param,
                 function(data) {
                   $('#container').html(data);
                 }
             ).fail(function(error) { alert(error.responseJSON) });
          });
  });
  </code></pre>
  
  <p>Other things I've tried:
  1) Changing browsers to Safari (same thing, server returns information but the site gets an error)
  2) Setting async = true from false. For some reason when I set it to true, the server doesn't respond at all. When it's false the server responds.</p>