shaack / cookie-consent-js

A simple dialog and framework to handle the German and EU law about cookies in a website (December 2021)
MIT License
71 stars 20 forks source link

Strict mode + TypeError #1

Closed mokorana closed 2 years ago

mokorana commented 3 years ago

Uncaught TypeError: Cannot set property 'modal' of undefined at scripts.js:123

shaack commented 3 years ago

Hi, cookie-consent-js has no file scripts.js.

mokorana commented 3 years ago

Yes, you are right. I just loaded your script as a module in my own scripts.js. Because I use strict mode, the error was displayed. I can deal with this by myself. I just wanted to let you know.

shaack commented 3 years ago

Okay, nice, but what exactly is the error? :)

mokorana commented 3 years ago

Problem is that this is undefined in hideDialog() and showDialog(). As a simple fix you could use window.modal instead.

shaack commented 2 years ago

Fixed. Thanks for reporting!