Hello,
I have a website where I am wanting to get some query results through AJAX and JSON, but I have absolutely no idea how to do it, I have this function,
public function category() {
$table = $this->uri->segment(2);
$content_id = $this->uri->segment(3);
$data['content'] = $this->site_model->get_content($table, $content_id);
$this->load->view('template/right-content', $data);
}
Essentially the query that is run is dynamic depending on what url is being passed, what I need to is, for the user clicks a link something like
<a href="/category/blog/1" id="blog">Read the blog</a>
From this link I get blog and 1 passed to the query, but I need to load the results in a view that is loaded in to my main template and then everytime a link is clicked do the same thing without overwriting the previous data, does anyone have any idea how to do this?