Skip to content

Instantly share code, notes, and snippets.

@bvibber
Created December 7, 2011 00:15
Show Gist options
  • Save bvibber/1440752 to your computer and use it in GitHub Desktop.
Save bvibber/1440752 to your computer and use it in GitHub Desktop.
$(function() {
$statusbar = $('#status-top');
// Only do the rest if we have the statusbar!
if ($statusbar.length > 0) {
function updateOnlineStatusBar() {
// ... code to fetch and update
}
// Update the status every couple minutes if we leave the page open
window.setInterval(updateOnlineStatusBar(), 120 * 1000);
updateOnlineStatusBar();
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment