3.2.17 • Published 1 month ago
cookie-warn v3.2.17
Cookie Warn
EU Cookie Law warning message
Preview
Features
- jQuery not required
- multilanguage support
- customizable style
- responsive
- Bootstrap detect
- adjustable delay and expire days
- callback
Examples
Example 1
- without parameters
<html lang="en">
<script id="cookieScript" type="text/javascript" src="../cookie-warn.min.js"></script>
Example 2
- all parameters
- texts and links by html lang attribute
<html lang="en">
<script
id="cookieScript"
data-lang-en="{
'text': 'Our website uses cookies.',
'more_text': 'Click here for more information',
'more_link': 'https://ec.europa.eu/info/law/law-topic/data-protection_en',
'accept_text': 'I accept',
'reject_text': 'I reject',
'reject_info': 'You can disable unwanted cookies by using this program',
'reject_link': 'https://www.ghostery.com/'
'close_text': 'Close'
},
}" (optional, setup texts and links)
data-callback="cookieWarnCallback" (callback function name, optional)
data-debug="true" (show debug info in console, optional)
data-expire="365" (default 365 day, optional)
data-domain="*.domain.tld" (cookie domain, optional)
data-path="/" (cookie path, optional)
data-secure="true" (cookie secure https, optional)
data-delay="750" (default 500, optional)
data-class="customCookieWarningClass" (optional)
data-style="#cookieScriptBox a { color: #ff0000; }" (optional)
type="text/javascript"
src="../cookie-warn.min.js">
</script>
<script>
const cookieWarnCallback = function(accepted) {
if (accepted) {
// do something...
} else {
// do nothing...
}
};
</script>
Example 3
- with default parameters
- texts and links by html lang attribute
<html lang="en">
<script type="text/javascript" src="../cookie-warn.min.js"></script>
<div
id="cookieScript"
data-lang-en="{
'text':'Our website uses cookies.',
'accept_text':'Accept all',
'accept_essential_text':'Accept only essential',
'more_text':'Click here for more information',
'more_link':'https://ec.europa.eu/info/law/law-topic/data-protection_en'
}"
data-lang-hu="{
'text':'Weboldalunk sütiket használ.',
'accept_text':'Elfogadom',
'more_text':'Kattints ide a bővebb információért',
'more_link':'https://ec.europa.eu/info/law/law-topic/data-protection_hu'
}">
</div>
Todo
- accept cookies by types (necessary, all, custom)
3.2.17
1 month ago
3.2.16
1 month ago
3.2.15
3 months ago
3.2.13
7 months ago
3.2.12
8 months ago
3.2.14
6 months ago
3.2.11
10 months ago
3.2.9
1 year ago
3.2.8
1 year ago
3.2.7
1 year ago
3.2.5
1 year ago
3.2.4
1 year ago
3.2.3
2 years ago
3.2.2
2 years ago
3.2.1
2 years ago
3.1.24
2 years ago
3.1.23
2 years ago
3.1.20
3 years ago
3.1.18
3 years ago
3.1.15
3 years ago
3.1.10
3 years ago
3.1.7
3 years ago
3.1.6
4 years ago
3.1.5
5 years ago
3.1.4
5 years ago
3.1.3
5 years ago
3.1.2
5 years ago
3.1.1
5 years ago
3.0.10
5 years ago
3.0.7
5 years ago
3.0.6
5 years ago
3.0.4
6 years ago
3.0.2
6 years ago
3.0.1
6 years ago
2.0.3
6 years ago
2.0.2
6 years ago
2.0.1
6 years ago