[eluser]LuckyFella73[/eluser]
Your Ajax controller has to return the result as json.
You can't just load a view in your controller to get a json result.
Your controller function should more look like:
Code:
public function GetOnlineUsers()
{
$this->load->model('home_page_model');
die(json_encode($this->home_page_model->onlineUsers())); // return result to ajax function
}
If you want to format (HTML) the result before the data is send to the js function
you can do that too.
EDIT:
I looked at your controller code and saw your json_encode function so
I thought you expect a json as the result for your js function. But
now I see you use the jquery "load" function. So my code might not
help you.
Can you post what kind of errors do you get?