title: jQuery ajax function returns an error
body: <p>to be honest, I'm a total beginner with jQuery and now I'm stuck. I want to send data from my HTML form to a php, it adds the data to a database and returns some value that I'd like to display on my original HTML. Here's my code:</p>
  
  <pre><code>$.ajax({
    type: "POST",
    url: "http://mysite.com/process.php",
    data: { data: mydata },
    cache: false,
    dataType: "text",
    error: function(jqXHR, textStatus, errorThrown){
          alert(jqXHR.status);
          alert(jqXHR.statusText);
          alert(jqXHR.responseText);
      },
    success: function(data){
          getContentBox().innerHTML = data;
  }
  });
  </code></pre>
  
  <p>It returns a jqXHR object with <code>status</code>=0, <code>statusText</code>="error" and empty <code>responseText</code>. However, my php seems to work, I see my data inserted in my DB. What am I doing wrong?</p>
  
  <p>Any help would be appreciated.
  Thanks in advance!</p>
  
  <p>EDIT: 
  Chrome console says 
  XMLHttpRequest cannot load <a href="http://mysite.com/data.php">http://mysite.com/data.php</a>. Origin <a href="http://www.mysite.com">http://www.mysite.com</a> is not allowed by Access-Control-Allow-Origin.</p>