Open kaszarobert opened 2 years ago
It seems we need to create event manually. Here's my example with jQuery:
// Fire a cookie's event.
let services = $.cookie('cookiesjsr');
if (services) {
services = JSON.parse(services);
}
else {
services = {};
}
let options = {services: services};
document.dispatchEvent(new CustomEvent("cookiesjsrUserConsent", {detail: options}));
Using the cookiesjsrUserConsent event, everything works fine during page load. It blocks what it needs to when not given consent. What can we do with dynamically loaded contents and AJAX updates? How can we determine if the newly loaded content should be blocked or not? Do we have to read from cookies or do we have to create a cookiesjsrUserConsent event manually?