/cookie-law-banner

Insert a JavaScript banner to warn the users that the website uses cookies

Primary LanguageJavaScriptMIT LicenseMIT

cookie-law-banner

Extremely simple and highly customisable vanilla JavaScript script to create a banner that warns the users that the website uses cookies.

When the user accepts a specific cookie is set on the browser.

The script can be used on any website, just add this code to the bottom of the body:

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

At the top of the script it is possible to change:

  • Banner text
  • Buttons text
  • URL of the webpage with the cookies description
  • Position of the banner (top/bottom)
  • Possibility to accept clicking via a link or scrolling the page

The script must run on a server otherwise the cookie is not set up

See an example here: http://codepen.io/vanni/pen/zZoxdY

License