title: how to display JSON data in html div
body: <p>Here is my JSON string:</p>
  
  <pre><code>[[{"name":"Pepe Pinedo"},{"message":"something"},{"datein":"2015-07-01 11:12:34"}],[{"name":"Pepe Pinedo"},{"message":"something"},{"datein":"2015-07-01 11:14:30"}]]
  </code></pre>
  
  <p>here's my js code</p>
  
  <pre><code>$.post(url, function( data ) { //fire ajax post request
      alert("Got messages: " + data); //                         
      /*$.each(data, function(index,e){
          content += e.name + ':'+ e.message +'&lt;br&gt;';
          $("#chatbox").append(content);
      });*/    
  });
  </code></pre>
  
  <p>I was trying to make the messages look like this:</p>
  
  <p><img src="https://i.stack.imgur.com/48WfT.jpg" alt="enter image description here"></p>
  
  <p>Php</p>
  
  <pre><code>$messages = $this-&gt;person_model-&gt;get_msg();
   foreach ($messages as $i =&gt; $valor) {
                      $fila['name']       = $valor-&gt;names;
                      $message['message'] = $valor-&gt;message;
                      $fecha['fecha']     = $valor-&gt;datein;
                      $data[] = array($fila, $message,$fecha);
  
              }
              echo json_encode($data); 
  </code></pre>
  
  <p>any help would be appreciated</p>