Skip to content

Instantly share code, notes, and snippets.

@jblac
Created February 19, 2013 21:06
Show Gist options
  • Save jblac/4989922 to your computer and use it in GitHub Desktop.
Save jblac/4989922 to your computer and use it in GitHub Desktop.
function getNotificationsCount() {
$.ajax({
url: '/notifications/count',
type:'GET',
success: function(response) {
if (response < 1) {
$('.nCount').hide();
} else {
$('.nCount').text(response).show();
}
}
});
}
getNotificationsCount();
setInterval(getNotificationsCount, 6000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment