Handle set-cookie button click
-
I think there is an error with the setter of the event ‘click’ in front.js file.
The event is looking for an element with ‘cn-set-cookie’ class defined and I didn’t find an element with this class in the generated html and the cookie message don’t dissapear when I click on it.If I change the event to find an element with ID attribute like ‘cn-accept-cookie’ the cookie message dissaper correctly when I click on it.
Summary
Does not work
// handle set-cookie button click
$( document ).on( ‘click’, ‘.cn-set-cookie’, function ( e ) {
e.preventDefault();
$( this ).setCookieNotice( $( this ).data( ‘cookie-set’ ) );
} );Does work
// handle set-cookie button click
$( document ).on( ‘click’, ‘#cn-accept-cookie’, function ( e ) {
e.preventDefault();
$( this ).setCookieNotice( $( this ).data( ‘cookie-set’ ) );
} );Is this correct?
The topic ‘Handle set-cookie button click’ is closed to new replies.