title: Joomla JSON.parse: unexpected non-whitespace character after JSON data
body: <p>I want to use jQuery.ajax for sending new mark(about article) to database and changind number of marks on page.
  But I receive bad AJAX response from server.</p>
  
  <pre><code>{"likes":"40","dislikes":"29"}{"success":true,"message":null,"messages":null,"data":[]}
  </code></pre>
  
  <p>and error: </p>
  
  <blockquote>
    <p>SyntaxError: JSON.parse: unexpected non-whitespace character after
    JSON data at line 1 column 31 of the JSON data</p>
  </blockquote>
  
  <p>It seems there must not be the second ajax response. But I'm not understand where it have taken.</p>
  
  <p>That is my php code from Joomla plugin.</p>
  
  <pre><code>$marks = plgContentLikesHelper::getMarks($articleID);
          $data=array();
          $data['likes'] = $marks-&gt;likes;
          $data['dislikes'] = $marks-&gt;dislikes;
          echo json_encode($data);
  </code></pre>
  
  <p>That is my jQuery code from Joomla plugin.</p>
  
  <pre><code>jQuery(document).ready(function(){
  
              jQuery('div.plg-likes &gt; a ').click(function (e) {
                  var id = jQuery(this).parent('div.plg-likes').attr('id');
                  var opinion = jQuery(this).attr('id');
  
                  jQuery.ajax({
                      type: "POST",
                      dataType: "json",
                      url: "index.php?option=com_ajax&amp;group=content&amp;plugin=likes&amp;format=json",
                      data: { articleId: id, articleOpinion: opinion },
                      success: function(data){  /* troubles are here */
                              alert(data["likes"]);
                      }
                  })
                  return false;
              })
          })
  </code></pre>