Last active
May 17, 2022 06:22
-
-
Save bavington/6727776 to your computer and use it in GitHub Desktop.
Simple EU Cookie Law Banner JavaScript
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks @bavington and @timgerhard, this is simple and useful. I did a minor change as some people said, refreshing the page without closing the banner, it will just disappear, when createCookie function is called I create the cookie with a different value let's say "off" so if you reload the page function checkCookie looks for specific value, since it is different it will display the banner again when the user clicks to close the banner function removeMe is invoked so there I update the cookie value to "on".
Thanks.