"+ result.data[i].message + "
\
"+ moment(result.data[i].createdDate).fromNow()+" "
}
$('#notifications-list').append(html);
}
}
});
}
function fetchCount() {
console.log("inside Count headerStatic-")
$.ajax({
type: 'GET',
dataType: "json",
url: "/count/" + userId,
success: function (result) {
console.log('within ajaaaaaax',result)
console.log('data-------------------',result.data)
if(result.data!=0){
//console.log('if',result.data)
$('#cartCount').show();
document.getElementById("cartCount").innerHTML = result.data;
}
else
console.log('else',result.data)
}
});
}
function attachLatest(data) {
if(data.currency) {
if(status == "insert")
var content = "New currency of value " + data.currency.currencyValue + " under " + data.countryName + "(" + data.currencyCode + ") added"
else if(status == "update")
var content = "Currency of value " + data.currency.currencyValue + " under " + data.countryName + "(" + data.currencyCode + ") is out of circulation"
} else if(data.coin) {
if(status == "insert")
var content = "New coin of value " + data.coin.coinValue + " under " + data.countryName + "(" + data.currencyCode + ") added"
else if(status == "update")
var content = "Coin of value " + data.coin.coinValue + " under " + data.countryName + "(" + data.currencyCode + ") is out of circulation"
}
$('#notifications').show();
$("#notification-all").show();
$('.list-nothing').empty();
var html='';
html = html + "