• 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 don’t find an element with this class in the generated html and the cookie message don’t hide when I click on it.

    If I change the event to find an element with ID attribute like ‘cn-accept-cookie’ the cookie message hide 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?

    https://wordpress.org/plugins/cookie-notice/

The topic ‘Handle set-cookie button click’ is closed to new replies.