Comments (5)
Can you create a jsfiddle (or similar, the point is to create a reduced test case) showing your way of doing async mode loading (and the banner then not appearing)?
from cookie-banner.
Thank you for the answer. I tried in this way: http://jsfiddle.net/o7cr4o6d/1/
If i tried in jsfiddle, with this async mode the banner appeared, but in wordpress it doesn't. Are there other way to load it?
from cookie-banner.
Cool, that's progress (kind of).
It suggests there might be some other scripts queued in WP that are causing conflicts (or even errors). Most likely from your theme and/or plugins. Are there any errors in the console when you try it in WP?
Yes, there are other ways to run/invoke the banner. Load the JS in a <script>
tag without id="cookiebanner"
(that way it will not auto-start). Then you can create a new Cookiebanner()
"instance" yourself and call run()
on it (for example from jQuery's ready()
function or similar).
You'll just have to configure it completely using a JS object yourself -- see how the tests are done.
from cookie-banner.
It seems that there are no errors. Very interesting the way you suggested. So, i want to try last chance.
I load the JS in script tag with async and remove the "id=cookiebanner". In this way Google PageSpeed is ok! Then how can i proceed ?
Sorry but i'm not a developer, can you update my jsfiddle with code to load new jQuery instance? http://jsfiddle.net/o7cr4o6d/2/
Thank you :)
from cookie-banner.
Something along the lines of http://jsfiddle.net/o7cr4o6d/3/ should hopefully work (once the reference to ../cookie-banner.js is working, obviously, and jQuery is loaded)
from cookie-banner.
Related Issues (20)
- banner disappears on page reload HOT 1
- Could you help add git tag HOT 10
- .cookiebanner-close element missing HOT 2
- Styling option not working HOT 1
- acceptOnFirstVisit: true HOT 4
- Multi-line data-message HOT 2
- EU Cookie Law changes in 2018 HOT 33
- magnific-popup integration HOT 1
- Empty linkmsg causes error HOT 4
- Cookie Expire Date HOT 4
- Charset + Force into foreground HOT 4
- data-on-closed="" seems to loop? HOT 1
- Callbacks not working on dist/cookiebanner.min.js HOT 4
- Two links in the message possibility HOT 2
- Suggestion: allow "accept-on-navigation"
- Does not show up in Firefox or Chrome HOT 2
- Allow hide "More Info" link HOT 2
- Opt-In Mandatory in 2019
- `expires` option doesn't work with Firefox. HOT 14
- suggestion: change URL from http to https
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cookie-banner.