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:
Controller:
public function blog($id) {
$data['comments'] = $this->Comments->findall('blog', $id);
$this->load->view('sites/blog', $data);
}
Model:
... reading from database ...
View:
<div id="comments">
reading data from $comments sent by controller blog
</div>
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:
<? $this->load->view('sites/comments'); ?>
And refresh this DIV using jQuery this is unsuccessful because the data sent by the controller remain unchanged :/