PageSourceSearch

https://www.visitwestlothian.co.uk/js/cookies.js

js visitwestlothian.co.uk collected 2026-10-02 12:14:52 UTC 961 bytes, 36 lines download raw bytes

1function createCookie(cname, cvalue, exdays) {
2    var d = new Date();
3    d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000));
4    var expires = "expires="+d.toUTCString();
5    document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/";
6}
7
8function catchCookie(cname) {
9    var name = cname + "=";
10    var ca = document.cookie.split(';');
11    for(var i = 0; i < ca.length; i++) {
12        var c = ca[i];
13        while (c.charAt(0) == ' ') {
14            c = c.substring(1);
15        }
16        if (c.indexOf(name) == 0) {
17            return c.substring(name.length, c.length);
18        }
19    }
20    return "";
21}
22
23var cookieName = "westLothianCookie";
24
25function checkCookie() {
26    var user = catchCookie(cookieName);
27    if (user == "") {
28        $(".c-cookies").slideDown();
29    } 
30} checkCookie();
31
32
33$(".js-accept--cookies").click(function(){
34    createCookie(cookieName, 'seen',1);
35    $(".c-cookies").slideUp();
36});

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.