How to pass a php json encoded variable to a jquery function using codeigniter? My code
$data['customerlist'] = $this->customerlist->customerchart();
//print_r($data['customerdata']);
$data['encoded_data'] = json_encode($data);
//print_r($data['encoded_data']);
if(empty($data['encoded_data']))
{
$data['comment']='No Record Found !';
}
$this->load->view('graph', $data);
and in my graph.php; i have this,
$(document).ready(function() {
PageViews($encoded_data);
});