[eluser]Pet[/eluser]
Hello there.I am actually running on this problem for days. I'm trying to send a json object to be handled by jquery $.get(). Here is the code for my controller.
$data = array(
// old
//'feeds' => $this->_feeds(0, $group, $friend_id, NULL, NULL, NULL, $header),
// new
'feeds' => $this->_feeds2($page = 0, $group, $friend_id, NULL, NULL, NULL, $header),
'owner_id' => $this->owner_id,
'friend_id' => $friend_id,
'group' => $group,
'type' => 'all',
'header' => $header,
);
$json = array(
'error' => FALSE,
'html' => $this->page->template($data, 'fragments/feeds'->(view template), NULL->(content_path_on template), TRUE),
);
$this->output
->set_content_type(HTTP_CONTENT_TYPE_JSON->"constant we use")
->set_output(json_encode($json));
}
This code is just a templating engine we use.
$this->page->template($data, 'fragments/feeds', NULL, TRUE)
Ok so I send an output. How can I specify the output to my jquery or how can I capture this output on my jquery?...any ideas?.. TNX