Creating Cookie Notification With Vanilla JavaScript – CookieNoticeJS

Category: Javascript , Notification | July 19, 2018
Author: micc83
Views Total: 3,221
Official Page: Go to website
Last Update: July 19, 2018
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.',
        '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:

07/19/2018

  • new options

You Might Be Interested In:


Leave a Reply