Reputation: 9977
I am using the js-cookie plugin and I want to know how to use it in an if statement. In my scenario I want to show a popup if the Cookie does not exist.
Cookie
Cookies.set('adModalOpen', 'true', { expires: 8/24 });
If Statement
if ( !Cookies.get('adModalOpen') === 'true' ) {
// show popup
}
I've tried a using === Null
but that didn't work either.
Upvotes: 1
Views: 652