Title: Javascript error stopping it working
Last modified: February 1, 2018

---

# Javascript error stopping it working

 *  [fullworks](https://wordpress.org/support/users/fullworks/)
 * (@fullworks)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/javascript-error-stopping-it-working/)
 *     ```
       Uncaught ReferenceError: lidd_mc_script_vars is not defined
           at HTMLFormElement.<anonymous> (lidd-mc.js:95)
           at HTMLFormElement.dispatch (jquery.min.js:3)
           at HTMLFormElement.r.handle (jquery.min.js:3)
       ```
   
 * line 95
    `var cp = lidd_mc_script_vars.compounding_period;`
 * On calculate, so no result.
 * Looks like variables are not being passed from settings page.
 * Have tried re-saving options.
 * Can you take a look?

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Thread Starter [fullworks](https://wordpress.org/support/users/fullworks/)
 * (@fullworks)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/javascript-error-stopping-it-working/#post-9925921)
 * OK the problem lies here
    `function lidd_mc_are_scripts_required() {`
 * in
 *     ```
       if ( lidd_mc_detect_widget() || lidd_mc_detect_shortcode() ) {
       		lidd_mc_enqueue_scripts();
       	}
       ```
   
 * And detect shortcode isn’t detecting coded shortcode built into the theme
 * `do_shortcode( '[mortgagecalculator]' );`
 * The way this function is coded it cant work.
 * Maybe
    1) a function to call e.g. lidd_there_is_a_shortcode_here() that forces
   it or simpler put lidd_mc_detect_shortcode() in class and allow overbidding
 *  Thread Starter [fullworks](https://wordpress.org/support/users/fullworks/)
 * (@fullworks)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/javascript-error-stopping-it-working/#post-9926630)
 * Ok this is the way to solve this problem.
 * In the template that uses do_shortcode add an action to enqueue the scripts even
   though they were not.
 * `add_action( 'wp_enqueue_scripts', 'lidd_mc_enqueue_scripts' );`
 *  [liddweaver](https://wordpress.org/support/users/liddweaver/)
 * (@liddweaver)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/javascript-error-stopping-it-working/#post-9960139)
 * Hey Fullworks. I’m glad you were able to solve this problem for yourself. I typically
   direct people to the FAQ for this type of issue. I’ve included a script in the
   plugin to manually load the scripts.

Viewing 3 replies - 1 through 3 (of 3 total)

 The topic ‘Javascript error stopping it working’ is closed to new replies.

 * ![](https://ps.w.org/responsive-mortgage-calculator/assets/icon-256x256.png?rev
   =1920811)
 * [Responsive Mortgage Calculator](https://wordpress.org/plugins/responsive-mortgage-calculator/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/responsive-mortgage-calculator/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/responsive-mortgage-calculator/)
 * [Active Topics](https://wordpress.org/support/plugin/responsive-mortgage-calculator/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/responsive-mortgage-calculator/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/responsive-mortgage-calculator/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [liddweaver](https://wordpress.org/support/users/liddweaver/)
 * Last activity: [8 years, 7 months ago](https://wordpress.org/support/topic/javascript-error-stopping-it-working/#post-9960139)
 * Status: not resolved