title: Ajax $.getJSON method to return html and json together
body: <p>Is there a way to fetch html data and json data together from the server using ajax getjson or any other method.</p>
  
  <p>For example, </p>
  
  <p><strong>Fetch.php  contains following:</strong></p>
  
  <pre><code>$count=$conn-&gt;rowCount();
  while($fetch=$query-&gt;fetch()) {
  echo "This is data"; 
  } 
  
  $array=array("itemcount" =&gt; $count);
  echo json_encode($array);
  </code></pre>
  
  <p>What I want from above fetch.php file is to return html data as well as $count value.</p>
  
  <pre><code>$.getJSON( 'fetch.php', {'id': uid}, function(data){
      $('#results').append(data);
     $('#offset').(data.itemcount); 
  }
  </code></pre>
  
  <p>But this is not working. It seems getjson method is not designed to display html data. Then at the same time I could not display json with $.POST method either.  What is the solution to this problem then? </p>
  
  <p>Thanks
  Nikhil  </p>