Topic: Modal cookie and modal popup dont work
demzl25 pro asked 5 months ago
When you enter the website the Modal cookie and Modal popup need to work.
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 5 months 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.
<script defer src="js/mdb.min.js"></script> or add
demzl25 pro commented 5 months ago
Thanks that solves issue!
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
- User: Pro
- Premium support: No
- 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