cookie_consent icon indicating copy to clipboard operation
cookie_consent copied to clipboard

Optionen funktionieren nicht

Open eaCe opened this issue 5 years ago • 3 comments

Wenn ich versuche eigene Optionen anzugeben bekomme ich den Fehler:

Die gegebenen Optionen liegen nicht im gültigen JSON-Format vor

Mein Versuch sieht so aus:

{
    onInitialise: function(status)
    {
        //do stuff
    }
}

Ist das Format falsch?

eaCe avatar Sep 27 '19 05:09 eaCe

Das klingt auf Anhieb nach einer älteren Version. Welche hast du installiert?

bloep avatar Sep 30 '19 18:09 bloep

Es ist die 2.1.0, hatte die 3.0 betas erst mal außen vor gelassen.

eaCe avatar Oct 01 '19 06:10 eaCe

onInitialise: function (status) {
 var type = this.options.type;
 var didConsent = this.hasConsented();
 if (type == 'opt-in' && didConsent) {
  alert(didConsent);
 }
 if (type == 'opt-out' && !didConsent) {
  alert(didConsent);
 }
}

die äußeren Klammern weglassen!

fietstouring avatar Oct 24 '19 07:10 fietstouring