Creating Cookie Notification With Vanilla JavaScript – CookieNoticeJS

Category: Javascript , Notification | August 20, 2021
Author:micc83
Views Total:4,306 views
Official Page:Go to website
Last Update:August 20, 2021
License:MIT

Preview:

Creating Cookie Notification With Vanilla JavaScript – CookieNoticeJS

Description:

CookieNoticeJS is a vanilla JavaScript library that display a cookie notice in a dismissable bottom banner to make your website comply with the EU cookie law.

How to use it:

Just download and include the cookie.notice.js in your document and done.

<script src="src/cookie.notice.js"></script>

Override the default settings by editing the cookie.notice.js.

var defaults = {
    'messageLocales': {
        'it': 'Utilizziamo i cookie per essere sicuri che tu possa avere la migliore esperienza sul nostro sito. Se continui ad utilizzare questo sito assumiamo che tu ne sia felice.',
        'en': 'We use cookies to make sure you can have the best experience on our website. If you continue to use this site we assume that you will be happy with it.',
        'de': 'Wir verwenden Cookies, um sicherzustellen, dass Sie das beste Erlebnis auf unserer Website haben können. Indem Sie unsere Dienste stimmen Sie der Verwendung in Übereinstimmung mit unseren Cookies Richtlinien.',
        'oc': 'Utilizam de cookies per vos provesir la melhora experiéncia possibla sus nòstre site web. Se contunhatz d\'utilizar aqueste site web considerarem que sètz d\'acòrdi amb aquò.',
        'fr': 'Nous utilisons des cookies afin d\'être sûr que vous pouvez avoir la meilleure expérience sur notre site. Si vous continuez à utiliser ce site, nous supposons que vous acceptez.'
    },
    'buttonLocales': {
        'en': 'Ok'
    },
    'cookieNoticePosition': 'bottom',
    'learnMoreLinkEnabled': false,
    'learnMoreLinkHref': '/cookie-banner-information.html',
    'learnMoreLinkText': {
      'it': 'Saperne di più',
      'en': 'Learn more',
      'de': 'Mehr erfahren',
      'fr': 'En savoir plus'
    },
    'buttonLocales': {
      'en': 'Ok'
    },
    'expiresIn': 30,
    'buttonBgColor': '#d35400',
    'buttonTextColor': '#fff',
    'noticeBgColor': '#000',
    'noticeTextColor': '#fff',
    'linkColor': '#009fdd'
};

Changelog:

08/20/2021

  • v1.2.1: Adds Occitan language

07/19/2018

  • new options

You Might Be Interested In:


3 thoughts on “Creating Cookie Notification With Vanilla JavaScript – CookieNoticeJS

Leave a Reply