Welcome Guest, Not a member yet? Register   Sign In
Retriving data from a db with an Ajax call
#1

[eluser]GabrieleMartino[/eluser]

The controller is simple

Code:
public function video_download ($page_id){
            header('Content-Type: application/x-json; charset=utf-8');
            $to_share = $this->chats_model->catch_shared_video($page_id);
            return json_encode($to_share);
}


#2

[eluser]GabrieleMartino[/eluser]
The answer is that is just

Code:
echo json

and not return




Theme © iAndrew 2016 - Forum software by © MyBB