title: How to answer to ajax request on server side?
body: <p>I've following function:</p>
  
  <pre><code>$.ajax({url:"http://127.0.0.1:8080", data: "123",
      success:
      function(response, textStatus, jqXHR) 
      {
          alert(response);
      },
      error:
      function(jqXHR, textStatus, errorThrown)
      {
          alert("The following error occured: " + textStatus + " " + errorThrown);
      }
  });
  </code></pre>
  
  <p>It sends request and i intercept one with "nc -l 8080".
  It looks like</p>
  
  <pre><code>GET /?123 HTTP/1.1
  Host: 127.0.0.1:8080
  User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:15.0) Gecko/20100101         Firefox/15.0.1
  Accept: */*
  Accept-Language: en-us,en;q=0.5
  Accept-Encoding: gzip, deflate
  Connection: keep-alive
  Origin: null
  </code></pre>
  
  <p>Then i answer with</p>
  
  <pre><code>HTTP/1.1 200 OK
  Content-Length: 3
  
  abc
  </code></pre>
  
  <p>The problem is i always get error ("The following error occured: error")
  What do you think could be wrong with it?</p>