Skip to content

Instantly share code, notes, and snippets.

@normansolutions
Created January 7, 2014 13:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save normansolutions/8299614 to your computer and use it in GitHub Desktop.
Save normansolutions/8299614 to your computer and use it in GitHub Desktop.
<br/>
<h3>Most recent visitors</h3>
<script>
(function doPoll() {
var count = 0;
$.ajax({
url: "http://YOUR_DOMAIN_NAME/plugins/clientaspxfiles/stmwhoonline.aspx",
dataType: "json",
success: function (json) {
var strHtml = '<ul>';
for (var i = 0; i < json.length; i++) {
strHtml += '<li><a href=\profile?guid=' + json[i].guid + ' title=' + json[i].logged + '>' + json[i].user + '</a></li>';
count++;
}
strHtml += '</ul>';
if (count < 10) {
$("#online").html(strHtml).hide().fadeIn();
} else {
$("#online").html(strHtml);
}
}
});
setTimeout(doPoll, 10000);
})();
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment