jQuery.noConflict();
var interval = 1000;
setTimeout(checkStatus, interval);
function checkStatus(){
jQuery.ajax({
method: "GET",
url: '/dashboard/notifications/new'
}).done(function(data){
notifications = jQuery.parseJSON(data);
notificationsUpdate(notifications);
});
// ie. every 1, 2, 3, 4, 5, 6, 7 secs, etc
interval += 1000;
// ie. double - every 1, 2, 4, 8, 16, 32 secs, etc.
// interval = interval * 2;
setTimeout(checkStatus, interval);
}
function notificationsUpdate(notifications){
// Code to handle notifications display
}