forked from diegolamonica/EUCookieLaw
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
33 lines (26 loc) · 887 Bytes
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title></title>
<script src="EUCookieLaw.js"></script>
<script>
new EUCookieLaw({
message: 'La legge europea richiede il tuo consenso prima di conservare i cookie. Me lo consenti?'
});
</script>
</head>
<body>
<p>
<button id="set-a-cookie">Set a cookie</button>
</p>
<pre id="cookies"></pre>
<script>
document.querySelector("#set-a-cookie").addEventListener("click", function () {
document.cookie = "test-cookie" + Math.random() + "=stored";
document.querySelector("#cookies").innerHTML = "Current document.cookie: <strong>" + document.cookie + '</strong>';
});
document.querySelector("#cookies").innerHTML = "Current document.cookie: <strong>" + (document.cookie ? document.cookie : 'undefined') + '</strong>';
</script>
</body>
</html>