title: Add if else function in Ajax Jquery function
body: <p>Is it possible to add other else function in my JS like this: ?</p>
  
  <p>if response == success redirect to home<br>
  if response == failed redirect to failed</p>
  
  <pre><code>$.ajax({
      type: "POST",
      url: action,
      data: form_data,
      success: function(response) {
          if (response == 'success') 
              window.location.replace("home");
          else 
              $("#message").html("&lt;div class='error_log'&gt;&lt;p class='error'&gt;Invalid username and/or password.&lt;/p&gt;&lt;/div&gt;");
      }
  });​
  </code></pre>