Skip to content

Instantly share code, notes, and snippets.

@Yiannistaos
Created January 25, 2022 11:00
Show Gist options
  • Save Yiannistaos/b7bb4a5e61fbafda84059f8604d1e418 to your computer and use it in GitHub Desktop.
Save Yiannistaos/b7bb4a5e61fbafda84059f8604d1e418 to your computer and use it in GitHub Desktop.
Redirect the User to another page or close the page after clicking on the reject button with the Web357 Cookies Policy Notification Bar Joomla! Plugin
<script type="text/javascript">
/**
* TRIGGER EVENTS
* Trigger events for the Cookies Policy Notification Bar Joomla! Plugin by Web357
* cpnb-trigger-events-web357.js
*/
window.addEventListener('load', function ()
{
setTimeout(() => {
var cpnb_decline_btn = document.getElementById("cpnb-decline-btn");
if(cpnb_decline_btn)
{
cpnb_decline_btn.addEventListener("click", function(){
// alert("You clicked " + cpnb_decline_btn.id);
window.location.replace("https://web357.com");
});
}
var cpnb_decline_btn_m_info = document.getElementById("cpnb-decline-btn-m-info");
if(cpnb_decline_btn_m_info)
{
cpnb_decline_btn_m_info.addEventListener("click", function(){
// alert("You clicked " + cpnb_decline_btn_m_info.id);
window.location.replace("https://web357.com");
});
}
var cpnb_decline_btn_m = document.getElementById("cpnb-decline-btn-m");
if(cpnb_decline_btn_m)
{
cpnb_decline_btn_m.addEventListener("click", function(){
// alert("You clicked " + cpnb_decline_btn_m.id);
window.location.replace("https://web357.com");
});
}
}, 250);
}, false);
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment