how to append content in a div via ajax using jquery

This article gives some basic knowledge about appending content within div if ajax response is json.

Html code
<div><a href='javascript:void(0)' onclick='ajax_append()'></a></div>
<div class='result'></div>
Ajax
If reponse is JSON then you can replace content like below.
<script>
function ajax_append() {
 $.ajax({
  url: URL,
  type: 'GET',
  complete: function (xhr, status) {
    if (status == 'success') {
      if (xhr.responseJSON['message'] == 'true') {
        $('.result').html(xhr.responseJSON['response'])
      }
    }
  }
 });
}
</script>