Topic: Modal cookie and modal popup dont work

demzl25 priority asked 1 year ago

Expected behavior

When you enter the website the Modal cookie and Modal popup need to work.

Actual behavior

Modal cookie and popup modal dont work on my website I m not sure what is wrong i got error in console Uncaught ReferenceError: mdb is not defined

Resources (screenshots, code snippets etc.)

Link to my website:

Mateusz Lazaru staff answered 1 year ago

It happens because you added defer to the MDB import.

<script defer src="js/mdb.min.js"></script>

The defer delays the loading of the package import, while custom.js loads immediately. As a result, the browser tries to initialize the modal before the MDB import.

solution: remove defer from <script defer src="js/mdb.min.js"></script> or add defer to <script src="js/custom.js"></script>

demzl25 priority commented 1 year ago

Thanks that solves issue!

Please insert min. 20 characters.


Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.



Specification of the issue

  • ForumUser: Priority
  • Premium support: Yes
  • Technology: MDB Standard
  • MDB Version: MDB5 5.0.0
  • Device: All
  • Browser: Chrome 97.0.4692.99
  • OS: window 10
  • Provided sample code: No
  • Provided link: Yes