UNPKG

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.

35 lines (31 loc) 1.61 kB
<!doctype html> <html lang="en"> <head> <title>cookie-consent-js - Example with Bootstrap 5</title> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <!-- cookie-consent-js stylesheet --> <link rel="stylesheet" href="../src/cookie-consent.css"/> <!-- Bootstrap CSS --> <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous"> <style> h1, h2 { margin-top: 2rem; } </style> </head> <body> <div class="container"> <h1><a href="../index.html">cookie-consent-js</a> - Example with Bootstrap 5</h1> <h2>API</h2> <button class="btn btn-primary mb-2" onclick="cookieConsent.reset()">Show the cookie settings dialog</button> <button class="btn btn-primary mb-2" onclick="console.log('trackingAllowed:', cookieConsent.trackingAllowed())">Log the status to the developer console</button> <script src="../src/cookie-consent.js"></script> <script> var cookieConsent = new CookieConsent({contentUrl: "../cookie-consent-content", privacyPolicyUrl: "privacy-policy-mockup.html"}) </script> </div> <!-- Optional JavaScript --> <!-- jQuery first, then Popper.js, then Bootstrap JS --> <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM" crossorigin="anonymous"></script></body> </html>