title: Codeigniter - refresh data sent to view with jQuery
body: <p>I have no idea how to refresh the data sent to the view using jquery without refreshing the entire web site. I wrote something like this:</p>
  
  <p>Controller:</p>
  
  <pre><code>public function blog($id) {
  
  $data['comments'] = $this-&gt;Comments-&gt;findall('blog', $id);
  $this-&gt;load-&gt;view('sites/blog', $data);
  
  }
  </code></pre>
  
  <p>Model:</p>
  
  <p>... reading from database ...</p>
  
  <p>View:</p>
  
  <pre><code>&lt;div id="comments"&gt;
  
  reading data from $comments sent by controller blog
  
  &lt;/div&gt;
  </code></pre>
  
  <p>How can I refresh DIV comments using jQuery in the view that the function in the controller BLOG read a new refreshed number of comments? 
  If I put in DIV comments code: </p>
  
  <pre><code>&lt;? $this-&gt;load-&gt;view('sites/comments'); ?&gt;
  </code></pre>
  
  <p>And refresh this DIV using jQuery this is unsuccessful because the data sent by the controller remain unchanged :/</p>