Adding Cookie JS to index.html
- March 30, 2021
- 2 replies
- 912 views
I'm having a little trouble adding a JS Cookie to the index.html built with Captivate. Quite frankly, it shouldn't be that difficult considering it's nothing more than <script> content and a file. What happens is that after I've inserted the code, the Cookie container flashes and then the Captivate slider appears but nowhere to be seen is the Cookie container, even though the code is present. However, if I was to load the scripts in a separate web file (as a tester), no problem! I can see and interact with the Cookie prompt.
Within the <body>:
<script type="text/javascript">
document.addEventListener('DOMContentLoaded', function () {
cookieconsent.run({"notice_banner_type":"standalone","consent_type":"express","palette":"light","language":"en","website_name":"webname","change_preferences_selector":"#changePreferences","cookies_policy_url":"https://www.fluhah.com/corporate/en/legal/privacy.html"});
});
</script>
Loader:
var lJSFiles = [ 'assets/js/jquery-3.3.1.min.js','assets/js/CPM.js','assets/js/cookie-consent.js'];
cookie-consent.js (attached as .txt)
There are no errors in the console displaying when attempting to make this work. I just can't get the Cookie consent container to appear after the slider loads.
Thank you for your assistance!
