JavaScript errors with modal code
-
I’m noticing issues with JavaScript on various pages using the modal code that Caldera actually provides in its own documentation: https://calderaforms.com/doc/opening-caldera-forms-modals-using-javascript/
With WP-Rocket on, I see errors either such as “Uncaught TypeError: Cannot read property ‘open’ of undefined” or “46b248c0afd82b2f7dcb83347d3295b0.js:1529 Uncaught TypeError: jQuery(…).remodal is not a function”. In either case. it’s this code exposing the errors:
<script> var inst = jQuery('[data-remodal-id=modal-CF5123456789012]').remodal(); inst.open(); </script>For obvious reasons, I changed the modal ID. But you get the idea.
Why is this code throwing errors? Is it due to the minification WP-Rocket produces?
The page I need help with: [log in to see the link]
The topic ‘JavaScript errors with modal code’ is closed to new replies.