可配置GDPR Cookie同意弹出窗口 jQuery弹出窗口同意.js

  • 源码大小:2.76MB
  • 所需积分:1积分
  • 源码编号:19JP-3788
  • 浏览次数:307次
  • 最后更新:2023年07月23日
  • 所属栏目:其他
我要下载
加入收藏
本站默认解压密码:19jp.com 或 19jp_com

简介

popupConsent.js是一个jQuery插件,允许您的页面和网络应用程序遵守欧洲Cookie法和GDPR。

它在页面加载时显示cookie同意弹出窗口,通知用户您的网站使用cookie,并提供cookie设置面板,用户可以在其中选择并接受某些cookie进行激活。

如何使用它:

1.将jQuery popupConsent.js插件的文件插入到您的文档中。

<link rel="stylesheet" href="popupConsent.css" />
<script src="/path/to/cdn/jquery.min.js"></script>
<script src="popupConsent.min.js"></script>

2.配置GDPR和Cookie同意弹出窗口。

var cookieConsentOptions = {

    // Cookie consent text
    'textPopup': 'We use cookies/targeted advertising to ensure you have the best experience on our site. If you continue to use our site, we will assume that you agree to their use. For more information, please see our <a href="#">privacy policy</a>.',

    // Accept button
    'textButtonAccept' : 'Accept all',

    // Config button
    'textButtonConfigure' : 'Configuring choices',

    // Save button
    'textButtonSave' : 'Save choices',

    authorization: [
      {
        textAuthorization: 'Allow access to geolocation data',
        nameCookieAuthorization: 'autoriseGeolocation'
      },
      {
        textAuthorization: 'Allow personalised ads and content, ad measurement and audience analysis',
        nameCookieAuthorization: 'targetedAdvertising'
      },
      {
        textAuthorization: 'Storing and/or accessing information on a device',
        nameCookieAuthorization: 'cookieConsent'
      }
    ]
    
}

3.初始化插件并完成。

popupConsent(cookieConsentOptions);

更新日志:

2.0.0版(2021-12-05)

  • 已修复Bug

预览截图