title: AJAX returns the complete HTML site instead the JSON object
body: <p>I finally could receive a response from my AJAX PHP call.
  But now in return I get my full HTML site instead of a JSON object or string.
  What is wrong here?</p>
  
  <pre><code>var request = $.ajax({
    url: "mysite.php",
    type: "POST",
    data: {select:requestStr},
    dataType: "html"
  });
  
  request.done(function( data ) {
    console.log(JSON.stringify(data));
  });
  </code></pre>
  
  <p>I send a simple string to my php class. This is what I get from the response-text in my developer tool from the browser:</p>
  
  <pre><code>data=Test
  </code></pre>
  
  <p>On PHP site I just return that respone:</p>
  
  <pre><code>&lt;?php
      $myData = array();
      $myData['data'] = "test";
      if (isset($_POST)) {
          $myData['data'] = $_POST;
      }
      echo json_encode($myData);
      exit();
  ?&gt;
  </code></pre>
  
  <p>And this is the console.log from the response:</p>
  
  <pre><code>"&lt;!DOCTYPE html&gt;\r\n&lt;html&gt;\r\n&lt;head&gt; ... &lt;/html&gt;\"Test\""
  </code></pre>
  
  <p><strong>EDIT</strong></p>
  
  <p>I only need the end of the response and that is <code>"Test"</code> but not the whole HTML file.</p>
  
  <p><strong>UPDATE</strong>
  I extracted my PHP class and wrote a Little Version like the PHP code above.
  But now my response is an empty object <code>{"data":[]}</code></p>