I want to pas this data to a javascript function that is in a javascript file :
    $data = $this->model_member->fetchMemberData();
The javascript function takes as a parameter  the id_member that's inside the $data variable.It is called on button click from a view, but if I pass the data to the view I'll have to load it and I don't want that since it is already loaded. How can I pass this data directly to the js function?
 
    