title: Bootstrap- jQuery AJAX showing "alert alert-danger" class on both error & success msg
body: <p>I am using Twitter Bootstrap 3 and using jQuery AJAX to send form data. Here is my code: </p>
  
  <pre><code>    $.ajax({ 
      type: $(form).attr('method'),
      url: $(form).attr('action'),
      data: $(form).serialize(),
      dataType: "json",
      success: function (response) {
          if (response.type = "error") {
              $('#msgs').html("&lt;div class='alert alert-danger'&gt;"+response.text+"&lt;/div&gt;");
              } else {
              $('#msgs').html("&lt;div class='alert alert-success'&gt;"+response.text+"&lt;/div&gt;");
          }
      }
   });
  </code></pre>
  
  <p>That should display error message with <strong>alert alert-danger</strong> class if <strong>type</strong> is <strong>error</strong> in json data &amp; with <strong>alert alert-success</strong> if <strong>type</strong> is <strong>success</strong> in json data. But it displays both error and success messages with <strong>alert alert-danger</strong>.</p>
  
  <p>What's wrong?</p>