Below is a piece of code from "Cookie Consent" regarding a cookie banner with a link. Problem: The code opens the link in a new tab instead of the same tab/window - see bottom of code. What needs to be added/changed to make this work? Also window.open("https://www.youraddress.com","_self")
doesn't seem to solve the problem. Edit2: Changing the "element" as suggested still doesn't produce the correct result...
<link rel="stylesheet" type="text/css"
href="//cdnjs.cloudflare.com/ajax/libs/cookieconsent2/3.0.3/cookieconsent.min.css" />
<script src="//cdnjs.cloudflare.com/ajax/libs/cookieconsent2/3.0.3/cookieconsent.min.js"></script>
<script>
window.addEventListener("load", function(){
window.cookieconsent.initialise({
"palette": {
"popup": {
"background": "#ebebeb",
"text": "#404040"
},
"button": {
"background": "#ff0099",
"text": "#ffffff"
}
},
"elements": {
"link": '<a aria-label="learn more about cookies" tabindex="0" class="cc-link" href="{{href}}" target="_self">{{link}}</a>',
},
"content": {
"href": "https://www.example.com/privacy-policy"
}
})});
</script>