Link to home
Start Free TrialLog in
Avatar of Robert Granlund
Robert GranlundFlag for United States of America

asked on

jQuery Error

I have the following line of code from a Mail Chimp Plugin:
<script>jQuery('#ns_widget_mailchimp_form-2').ns_mc_widget({"url" : "/index.php", "cookie_id" : "ns_widget_mailchimp-2", "cookie_value" : "c6f9f35ef27fb02131f8b4e0a821a4fe", "loader_graphic" : "../wp-content/plugins/mailchimp-widget/images/ajax-loader.gif"})(jQuery); </script>

Open in new window

The error I get is this:
Uncaught TypeError: jQuery(...).ns_mc_widget(...) is not a function

Here is the unrendered code:
<script>jQuery('#<?php echo $this->id_base; ?>_form-<?php echo $this->number; ?>').ns_mc_widget({"url" : "<?php echo $_SERVER['PHP_SELF']; ?>", "cookie_id" : "<?php echo $this->id_base; ?>-<?php echo $this->number; ?>", "cookie_value" : "<?php echo $this->hash_mailing_list_id(); ?>", "loader_graphic" : "<?php echo $this->default_loader_graphic; ?>"})(jQuery); </script>

Open in new window

Avatar of Margaret Green
Margaret Green
Flag of United States of America image

It could be:

jQuery javascript has loaded but the MailChimp javascript has not.
Avatar of Robert Granlund

ASKER

With the use of a developer tool maybe this will help in finding the error.
http://www.energyreco.com/development/
ASKER CERTIFIED SOLUTION
Avatar of hielo
hielo
Flag of Wallis and Futuna image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial