cookie-consent-js
Version:
A simple dialog and framework to handle the EU law (as written by EuGH, 1.10.2019 – C-673/17) about cookies in a website.
30 lines (27 loc) • 1.39 kB
HTML
<html lang="en">
<head>
<title>cookie-consent-js testpage</title>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="stylesheet" href="examples.css">
<link rel="stylesheet" href="../src/cookie-consent.css"/>
</head>
<body>
<h1><a href="../index.html">cookie-consent-js</a> - Reload after selection</h1>
<p>This page is reloaded after selection, using the "postSelectionCallback".</p>
<pre>var cookieConsent = new CookieConsent({postSelectionCallback: function() { location.reload()}, blockAccess: true})</pre>
<h2>API</h2>
<button onclick="cookieConsent.reset()">Show the cookie settings dialog</button>
<button onclick="console.log('trackingAllowed:', cookieConsent.trackingAllowed())">Log the status to the developer console</button>
<h2>Documentation</h2>
<ul>
<li><a href="https://github.com/shaack/cookie-consent-js">View the git repository and documentation for this project</a></li>
</ul>
<script src="../src/cookie-consent.js"></script>
<script>
const cookieConsent = new CookieConsent({postSelectionCallback: function() { location.reload()}, contentUrl: "../cookie-consent-content", blockAccess: true, privacyPolicyUrl: "privacy-policy-mockup.html", cookieName: "cc-block-tracking"})
</script>
</body>
</html>