Copy link to clipboard
Copied
Hi!
I've got a site that uses a cookie banner provided by OneTrust.com. I've placed the code that calls the JavaScript for the banner in the header (as instructed by OneTrust). OneTrust also provides a version of jQuery. When opening the site none of the content is loaded and only the banner is shown (only the text, not its background), and only when reloading the page does the rest load. This error exists almost exclusively on mobile phones. When disabling the jQuery provided by OneTrust the banner does not show at all. I know that Muse provides a version of jQuery, how can I make the cookie banner use that version instead? It seems that jQuery is loaded last in Muse and the cookie banner is loaded before that, making it not pop up at all. If I could run the script after all the content (and Muse's scripts) have been loaded, maybe it would work?
Thank you!
/Sven
yes the load | run order for code in Muse is [page head] then [page body] then [Master] head and [Master] body so for times when you need an order to things... like a popup timer you can split the code into different areas to have them run at different (but sequential) times
p.s, remember this bootstrap demo Nancy?
Copy link to clipboard
Copied
The important thing is have a jQuery version compatible with OnTrust. It does not matter where it comes from.
When javascript libraries are imported, they become available for the entire page.
Did you try to inspect the page content (Right button of the mouse> Inspect)?
A good thing would be to share the site here, so we can look at it together.
Copy link to clipboard
Copied
Try this one that does not rely on jQuery. Paste this code into your document's <head> tag.
<!--Cookie Conset CSS-->
<link rel="stylesheet" type="text/css" href="//cdnjs.cloudflare.com/ajax/libs/cookieconsent2/3.0.3/cookieconsent.min.css" />
<!--Cookie Consent JS-->
<script src="//cdnjs.cloudflare.com/ajax/libs/cookieconsent2/3.0.3/cookieconsent.min.js"></script>
<script>
//Invoke Cookie Consent on page load
window.addEventListener("load", function(){
window.cookieconsent.initialise({
"palette": {
"popup": {
"background": "#000"
},
"button": {
"background": "#f1d600"
}
}
})});
</script>
Copy link to clipboard
Copied
yes the load | run order for code in Muse is [page head] then [page body] then [Master] head and [Master] body so for times when you need an order to things... like a popup timer you can split the code into different areas to have them run at different (but sequential) times
p.s, remember this bootstrap demo Nancy?