title: if / else statements not working within AJAX response function
body: <p>I'm completely bewildered here. Before I start I should say that all my code is working 100%, and this issue has appeared for no apparent reason. </p>
  
  <p>An AJAX call is made when a user clicks a button, and a form is returned if the conditions are met. Then when a user submits the form, it makes another AJAX call and submits the data, again, if the conditions are met. The data submits successfully, and returns either 'success', or 'error_1', 'error_2' etc.</p>
  
  <p>What's not working is simply the if/else statements within response function in the JS.</p>
  
  <p>Here is the PHP callback function:</p>
  
  <pre><code>function submit_entry() {
  
  // my variables
  
  if($current_words &gt; $max_words) {
  
      echo 'max_words';
  
  } elseif($current_words &lt; $min_words) {
  
      echo 'min_words';
  
  } else {
  
      $post_data = array(
          'ID' =&gt; $entryID,
          'post_date' =&gt; date('YmdHis'),
          'post_content' =&gt; $text,
          'post_status' =&gt; 'publish'
      );
  
      wp_update_post($post_data);
  
      echo 'success';
  
  }
  
  exit;
  
  }
  </code></pre>
  
  <p>Here is the AJAX call:</p>
  
  <pre><code>jQuery('#entrySubmit').click(function() {
      jQuery.post(
          MyAjax.ajaxurl,
          {
              action : 'submit-entry',
              etc.
          },
          function( response ) {
  
              if(response == 'max_words') {
  
                  jQuery('#add_entry_error').html('You exceeded the maximum number of words.');
  
              } else if(response == 'min_words') {
  
                  jQuery('#add_entry_error').html('You have not written enough words, please write more.');               
  
              } else if(response == 'success') {
  
                  jQuery('#add_entry_step_1').slideUp();
                  jQuery('#add_entry_step_2').slideDown();
                  jQuery('#add_entry_error').html('');
  
              } 
              jQuery('#add_entry_error').append(response);
          }
      );  
  });
  </code></pre>
  
  <p>Here the <code>jQuery('#add_entry_error').append(response);</code> line successfully appends either <code>min_words</code>, <code>max_words</code>, or <code>success</code> - so why aren't the if statements working???
  There is no error in the console, and as I said it all works apart from the response.</p>