Welcome Guest, Not a member yet? Register   Sign In
Simple ajax question? Need help...
#1

[eluser]victorche[/eluser]
Hello and happy new year!

My problem is simple... I am using jQuery and I have a place on my index page, where I am showing the registered users count. Something like:
Quote:Active members: 132

So, the code for this is simple (Welcome Controller):
Code:
$count = $this->users->count_active_users();

$data = array(
    'count' => $count,
    ...,
    ...
);
And the view:
Code:
<div>
    Active members: <span id="count">{count}</span>
</div>
All I want to do is... To refresh this count, using ajax and jQuery. Which means, if there is a new registered user, the number to be updated, without manually to refresh the page.

Sounds really simple, but I can not do it. I found 14243465 tutorials on Google about Ajax/CI, but nothing simple like this.

Please, anyone?




Theme © iAndrew 2016 - Forum software by © MyBB