1

i'm using this script to block 3th part google scripts ( european cookies law)

It works but with some google maps scripts, after clicking "ok" to accept, i need to reload the page to see the map

<script src="cookies-enabler.js"></script>
<script>
    COOKIES_ENABLER.init({
        scriptClass: 'ce-script',
        iframeClass: 'ce-iframe',
        acceptClass: 'ce-accept',
        dismissClass: 'ce-dismiss',
        bannerClass: 'ce-banner',
        bannerHTML: '<p>Questa pagina usa cookies di terze parti. Per maggiori informazioni:<a href="privacy.php"> Privacy</a>&nbsp;&nbsp; Per continuare: '
                    +'<a href="#" class="ce-accept">'
                    +'Accetto i cookies'
                    +'</a>'
                    +'</p>',
        eventScroll: false,
        cookie: {
            name: 'ce-cookie',
            duration: 365
        },
        preventIframes: true
    });
</script>

How can i put some javascript code here to reload automatically the page on click?

   +'<a href="#" class="ce-accept">'

Thanks!

1 Answer 1

1

With pure JS, just use the window.location.reload() method:

+'<a href="javascript: window.location.reload()" class="ce-accept">'
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.