Topic: Modal cookie and modal popup dont work
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 https://www.regresija-hipnoza.si/js/custom.js:71
Resources (screenshots, code snippets etc.)
Link to my website: https://www.regresija-hipnoza.si/
mlazaru staff answered 2 years 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>
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Answered
- User: Pro
- 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