title: jQuery ajax handle response with .html()
body: <p>My Java controller gets data from the form and sends back a JSON boolean result:</p>
  
  <pre class="lang-java prettyprint-override"><code>@RequestMapping(value = "/person/save", ... )
  @ResponseBody
  public boolean savePerson(...) {
      ...
      return jpaPersonService.savePersonService(person);
  }
  </code></pre>
  
  <p>JS on form's submit button:</p>
  
  <pre class="lang-js prettyprint-override"><code>$('#savePersonForm').submit(function (event) {
      event.preventDefault();
      $.ajax({
          url: '/person/save',
          type: 'post',
          data: $('#savePersonForm').serialize(),
          success: function (response, textStatus, jqXHR) {
              console.log("ajax success");
              console.log("response: " + response);
              $('#result').html(response);
          },
          error: function (jqXHR, textStatus, errorThrown) {
              console.log('error(s):' + textStatus, errorThrown);
          }
      });
  });
  </code></pre>
  
  <p>In both cases when my controller sends back <code>true/false</code> I can see <code>response: true</code> or <code>response: false</code>. So I'm sure that JS gets an answer.  </p>
  
  <p>My next step is to add this answer into the div <code>#result</code>. If it is <code>true</code> - all is fine. If it is <code>false</code> I get an empty div. After some tests I've got that if I add text to the <code>response</code> it's working: <code>$('#result').html(response + '');</code>.<br>
  I'm using jquery-2.1.4.min.js.</p>
  
  <p>Do I have a mistake somewhere or is that supposed to be like that ? Thank you.</p>