title: Ajax request returns 200 OK, but an error event is fired instead of success
body: <p>I have implemented an Ajax request on my website, and I am calling the endpoint from a webpage. It always returns <strong>200 OK</strong>, but <strong>jQuery</strong> executes the error event.<br>
  I tried a lot of things, but I could not figure out the problem. I am adding my code below:</p>
  
  <h3>jQuery Code</h3>
  
  <pre><code>var row = "1";
  var json = "{'TwitterId':'" + row + "'}";
  $.ajax({
      type: 'POST',
      url: 'Jqueryoperation.aspx?Operation=DeleteRow',
      contentType: 'application/json; charset=utf-8',
      data: json,
      dataType: 'json',
      cache: false,
      success: AjaxSucceeded,
      error: AjaxFailed
  });
  function AjaxSucceeded(result) {
      alert("hello");
      alert(result.d);
  }
  function AjaxFailed(result) {
      alert("hello1");
      alert(result.status + ' ' + result.statusText);
  }
  </code></pre>
  
  <h3>C# code for <code>JqueryOpeartion.aspx</code></h3>
  
  <pre><code>protected void Page_Load(object sender, EventArgs e) {
      test();
  }
  private void test() {
      Response.Write("&lt;script language='javascript'&gt;alert('Record Deleted');&lt;/script&gt;");
  }
  </code></pre>
  
  <p>I need the <code>("Record deleted")</code> string after successful deletion. I am able to delete the content, but I am not getting this message. Is this correct or am I doing anything wrong? What is the correct way to solve this issue?</p>