Ok, we’ve created a custom jquery event for you. It’s called setCookieNotice and you can use it to tigger any type of action on button click.
You can use it like that:
$(document).on("setCookieNotice", myFunction);
function myFunction(e) {
// do something
}
This event is available in just released 1.2.24
Regards,
Bartosz /dfactory
Should be better if integrated in the plugin setting.
Example:
Option: “Refresh the page after user clicks on accept”.
However I put the following code in header.tpl, but it doesn’t work:
<script type=”text/javascript”>
$(document).on(“setCookieNotice”, myFunction);
function myFunction(e) {
location.reload();
}
</script>
What’s wrong in it?
OK I solved, here’s the correct version that I put in footer.tpl of my theme.
<script type=”text/javascript”>
jQuery(document).on(“setCookieNotice”, myFunction);
function myFunction() {
location.reload();
}
</script>
I vote up for including this:
Should be better if integrated in the plugin setting.
Example:
Option: “Refresh the page after user clicks on accept”.
It’s a problem with reports from Google Analytics without.
Also It would be a GREAT thing if this it would be also availble on page scroll or navigation