Hello im using codeigniter and then i echo out my output from the database in my controller and then in my view file i do this:
<script type="text/javascript">
$.getJSON('ajax/forumThreads', function(data) {          
alert(data.overskrift);
});
</script>
but it dont show anything :S
my model file
function forumList()
{
    $this->db->select('overskrift', 'indhold', 'brugernavn', 'dato');
    $this->db->order_by('id', 'desc');
    $forum_list = $this->db->get('forum_traad');
    if($forum_list->num_rows() > 0)
    {
        return $forum_list->result();
    } else {
        return false;
    }
}
my controller
function forumThreads() {
    $this->load->model('ajax_model');
    $data['forum_list'] = $this->ajax_model->forumList();
    if ($data['forum_list'] === true)
    {
        echo json_encode($data['forum_list']);
        $this->load->view('includes/footer', $data); 
    } else {
        return  false;
    }
}
 
     
     
     
    