creating cookies consent with .js code


Hi there,
before the 25 of may, all sites in EU must be GDPR compliant, so i found a cookie consent plug in made out of .js code (https://code.jquery.com/jquery-3.1.1.min.js) and one in css.
The only thing now is that when copy pasting the code i get the worse errors possible.
Please help, i honestly have no idea what i am doing?

clueless girl from the south of italy

Hey Francesca,

Welcome to the Wix Code forum.

First of all…

WixCode understands all of Javascript, except for anything that accesses the DOM.

This keeps the user from inadvertently “breaking” something. I myself tried to hack things from the code, from an iFrame, and in my dreams, but WixCode wasn’t having any of it.

Accessing document elements such as div, span, button, etc is off-limits. The way to access elements on the page is only through $w.

The good news is that Wix is fully aware of GDPR and offers various functions to site owners. See the article Preparing Your Wix Site for the GDPR for more information.

Good luck,

Yisrael

Hello

At the moment it is not possible to import a JS file into Wix Code. You can copy the file contents and create a JS file in backend folders and use it.

For more about Preparing Your Wix Site for the GDPR visit:
https://support.wix.com/en/article/preparing-your-wix-site-for-the-gdpr?referralAdditionalInfo=BIZ_MANAGER_HOME_LB

Also, i suggest you check this article: https://support.wix.com/en/article/tutorial-how-to-get-explicit-opt-in-consent-from-your-users-using-wix-code

Massa

The second link leads to an Error Page

See the latest articles concerning this topis.

This forum is dedicated to Corvid. If you have additional questions or concerns, you can contact the Wix support team . You’ll get better help for subject there.