I want to show message "New post" if there is no cookie. When you visit page four on the site, the site will set a cookie and on every other page message will be "No new posts". Problem is that this only works first time and when i deleted cookie, message was "No new posts" although there wasn't any cookie.
HTML:
<div class="news"></div>
jQuery:
function checkNews(){
if($.cookie('cookie_name')!==null){
$('.news').append('<div id="nonew">No new posts</div>');
}
else
{
$('.news').append('<div id="new_i">New post</div>');
}
};
So, what is the problem and why when i delete cookie the message doesn't change to "New post"?