Title: JavaScript errors with modal code
Last modified: November 5, 2018

---

# JavaScript errors with modal code

 *  [databell96](https://wordpress.org/support/users/databell96/)
 * (@databell96)
 * [7 years, 7 months ago](https://wordpress.org/support/topic/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/](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](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fjavascript-errors-with-modal-code%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

The topic ‘JavaScript errors with modal code’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/caldera-forms_475846.svg)
 * [Caldera Forms - More Than Contact Forms](https://wordpress.org/plugins/caldera-forms/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/caldera-forms/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/caldera-forms/)
 * [Active Topics](https://wordpress.org/support/plugin/caldera-forms/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/caldera-forms/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/caldera-forms/reviews/)

## Tags

 * [caching](https://wordpress.org/support/topic-tag/caching/)
 * [javascript](https://wordpress.org/support/topic-tag/javascript/)
 * [jquery](https://wordpress.org/support/topic-tag/jquery/)
 * [WP Rocket](https://wordpress.org/support/topic-tag/wp-rocket/)

 * 0 replies
 * 1 participant
 * Last reply from: [databell96](https://wordpress.org/support/users/databell96/)
 * Last activity: [7 years, 7 months ago](https://wordpress.org/support/topic/javascript-errors-with-modal-code/)
 * Status: not resolved