Problema implementar biblioteca jquery
Publicado por Alvaro (1 intervención) el 15/06/2021 11:35:22
estoy intentando implementar este jquey y algo falla (apenas sé html) y no sé qué es...
la biblioteca es este...
https://www.jqueryscript.net/other/cookie-consent-settings-modal.html
y el codigo es este (lo subrrayado lo he puesto en el head y el resto en el body,
El archivo bootstrap-cookie-consent-settings.js lo he subido a la raiz, donde el index. me despista la linea 4 "src/"...¿losw archivos de las lineas 1, 2 y 3, debo tenerlos en mi servidor?
Gracias de antemano
la biblioteca es este...
https://www.jqueryscript.net/other/cookie-consent-settings-modal.html
y el codigo es este (lo subrrayado lo he puesto en el head y el resto en el body,
El archivo bootstrap-cookie-consent-settings.js lo he subido a la raiz, donde el index. me despista la linea 4 "src/"...¿losw archivos de las lineas 1, 2 y 3, debo tenerlos en mi servidor?
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
<link rel="stylesheet" href="/path/to/cdn/bootstrap.min.css" />
<script src="/path/to/cdn/jquery.min.js"></script>
<script src="/path/to/cdn/bootstrap.min.js"></script>
<script src="src/bootstrap-cookie-consent-settings.js"></script>
var cookieSettings = new BootstrapCookieConsentSettings()
<!-- content/en.html -->
<div class="modal-dialog modal-lg shadow" role="document">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">Privacy Settings</h4>
</div>
<div class="modal-body">
<div class="bcb-body-text" style="font-size: 80%">
<!-- @formatter:off -->
<p>We use cookies and similar technologies that are necessary to operate the website. Additional cookies are only used with your consent. We use the additional cookies to perform analyses of website usage and to check marketing measures for their efficiency. These analyses are carried out to provide you with a better user experience on the website. You are free to give, deny, or withdraw your consent at any time by using the "cookie settings" link at the bottom of each page. You can consent to our use of cookies by clicking "Agree". For more information about what information is collected and how it is shared with our partners, please read our <a href="https://www.jqueryscript.net/privacy/">Data Protection Statement</a>.</p>
<!-- @formatter:on -->
</div>
<p><a href="./demo/legal-notice.html">Legal Notice</a>
<a href="#bcb-options" data-toggle="collapse" class="float-right">My settings</a>
</p>
<div id="bcb-options" class="collapse">
<div class="bcb-option" data-name="necessary">
<div class="custom-control custom-checkbox mb-1">
<input type="checkbox" checked disabled class="custom-control-input" id="bcb-checkboxNecessary">
<label class="custom-control-label" for="bcb-checkboxNecessary"><b>Necessary</b></label>
</div>
<ul>
<li>Required to run the website</li>
</ul>
</div>
<div class="bcb-option" data-name="analyses">
<div class="custom-control custom-checkbox mb-1">
<input type="checkbox" class="custom-control-input" id="bcb-checkboxAnalyses">
<label class="custom-control-label" for="bcb-checkboxAnalyses"><b>Analyses</b></label>
</div>
<ul>
<li>Monitoring website usage and optimizing the user experience</li>
<li>Evaluation of marketing actions</li>
</ul>
</div>
<div class="bcb-option" data-name="personalization">
<div class="custom-control custom-checkbox mb-1">
<input type="checkbox" class="custom-control-input" id="bcb-checkboxPersonalization">
<label class="custom-control-label"
for="bcb-checkboxPersonalization"><b>Personalization</b></label>
</div>
<ul>
<li>Storage of your preferences from previous visits</li>
<li>Collecting user feedback to improve our website</li>
<li>Recording of your interests in order to provide customised content and offers</li>
</ul>
</div>
</div>
</div>
<div class="modal-footer">
<button id="bcb-buttonDoNotAgree" type="button"
class="btn btn-link text-decoration-none">
I do not agree
</button>
<button id="bcb-buttonAgree" type="button" class="btn btn-primary">Agree</button>
<button id="bcb-buttonSave" type="button" class="btn btn-outline-dark">
Save selection
</button>
<button id="bcb-buttonAgreeAll" type="button" class="btn btn-primary">Agree to all</button>
</div>
</div>
</div>
var cookieSettings = new BootstrapCookieConsentSettings({
autoShowDialog: false
})
var cookieSettings = new BootstrapCookieConsentSettings({
// the language, in which the modal is shown
lang: navigator.language,
// supported languages (in ./content/)
languages: ["en", "de"],
// dialog content
contentURL: "./content/",
// cookie name stored as JSON
cookieName: "cookie-consent-settings",
// 365 days
cookieStorageDays: 365,
// callback function, called after the user has made his selection
postSelectionCallback: undefined
})
cookieSettings.showDialog();
// get all
cookieSettings.getSettings();
// get a specific setting
cookieSettings.getSettings("analyses");
Gracias de antemano
Valora esta pregunta
0