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 (29 loc) • 1.17 kB
HTML
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Privacy Policy</title>
<link rel="stylesheet" href="../src/cookie-consent.css"/>
<style>
body {
font-family: sans-serif;
line-height: 1.4;
}
</style>
</head>
<body>
<h1>Privacy Policy Mockup</h1>
<p>The cookie settings dialog is not automatically displayed, so the user can read the privacy policy before deciding on a setting.</p>
<p>This is achieved with the property autoShowModal, which is set to false.</p>
<pre><code>var cookieConsent = new CookieConsent({privacyPolicyUrl: "privacy-policy-mockup.html", autoShowModal: false, contentPath: "../cookie-consent-content"})</code></pre>
<p>To display the dialog anyway, the API function reset() can be used:</p>
<p>
<a href="javascript:cookieConsent.reset()">Show cookie settings</a>
</p>
<script src="../src/cookie-consent.js"></script>
<script>
const cookieConsent = new CookieConsent({privacyPolicyUrl: "privacy-policy-mockup.html", autoShowModal: false, contentUrl: "../cookie-consent-content"})
</script>
</body>
</html>