Looks pretty straightforward to me, but I'm no expert at PHP.
Incidentally, on the javascript side, you my alternatively use/return the arguments.callee property of a self executing anonymous function if you like:
Code:
<script type="text/javascript">
$(function() {
setInterval((function() {
$.getJSON('include/ajaxStats.php', function (data) {
$('#online').html(data.online);
$('#accts').html(data.accts);
$('#chars').html(data.chars);
});
return arguments.callee;
})(), 5000);
});
</script>
Which may appeal to the jQuery mindset more than my first solution does. Though I believe the first solution is a slight bit more efficient.
Bookmarks