title: Jquery Ajax success data from PHP echo not working
body: <p>I'm trying to get the data value on success from the php. However when I alert(data) in the success, it returns the page html.</p>
  
  <p>HTML:</p>
  
  <pre><code>&lt;input type="text" class="form-control" name="project_name" id="projectName" required&gt;
  </code></pre>
  
  <p>Jquery AJAX:</p>
  
  <pre><code>$('#projectName').on('blur', function(){
      var projectName = $(this).val();
      $.ajax({
          url: 'page.php',
          type: 'POST',
          dataType: 'text',
          data: {
              'projectChecked': 1,
              'project_name': projectName,
          },
          success: function(data){
              if (data == 'taken') {
                  $('#projectName').addClass('border-red');
              }
          }
      });
  });
  </code></pre>
  
  <p>PHP:</p>
  
  <pre><code>if(isset($_POST['projectChecked'])){
    echo 'taken'; 
    exit;
  }
  </code></pre>
  
  <p>Alert Message:</p>
  
  <pre><code>&lt;!DOCTYPE HTML&gt;
  &lt;html lang="en"&gt;
  &lt;head&gt;
  &lt;meta charset="utf-8"/&gt;
  &lt;link rel="shortcut icon" href="/favicon.png"/&gt;
  
  &lt;title&gt;Page Title&lt;/title&gt;
  &lt;meta name="description" content="Meta Description"&gt;
  &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8"&gt;
  &lt;meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no"/&gt;
  
  &lt;script src="https://code.jquery.com/jquery-3.4.1.min.js" integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlTw8HfCJo=" crossorigin="anonymous"&gt;&lt;/script&gt;
  
  &lt;!-- Global site tag (gtag.js) - Google Analytics --&gt;
  &lt;script async src="https://www.googletagmanager.com/gtag/js?id=UA-157194354-1"&gt;&lt;/script&gt;
  </code></pre>