Answer the question
In order to leave comments, you need to log in
Why doesn't the jquery cookie code work?
Tell me why this code does not work? Even if there is a cookie, the class is not deleted
if (!$.cookie('cookie_name')) {
$('#msg').addClass('blackZone');
$.cookie('cookie_name', 'cookie_value', {
expires: 5,
path: '/',
});
} else {
$('#msg').removeClass('blackZone');
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question