CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Installing CiviCRM »
  • WordPress Installations (Moderators: Kurund Jalmi, Coleman Watts) »
  • jQuery not working
Pages: [1]

Author Topic: jQuery not working  (Read 2586 times)

alexeightsix

  • I’m new here
  • *
  • Posts: 19
  • Karma: 0
  • CiviCRM version: 4.3
  • CMS version: 3.5.1
  • MySQL version: latest
  • PHP version: latest
jQuery not working
August 02, 2013, 09:29:43 am
I have the latest version of Wordpress and CiviCRM installed and for some reason CiviCRM won't enqueue the jQuery files necessary on my custom theme but it does indeed work if I switch the custom theme to the default WP theme. How is this possible? I disabled all my plugins, functions.php file,  created a very simple page.php template (I even created a 1 page theme with just an index and SAME ISSUE!):

<?php
wp_head();
if (have_posts()) {
    while (have_posts()) {
        the_post();
        the_content();
    //
      } // end while
} // end if
wp_footer();
?>

and I receive the following JS error:

Uncaught ReferenceError: cj is not defined

The only way to get the form to work w/o errors is to manually paste the includes:

 <script type="text/javascript">
        var CRM = {"config":{"userFramework":"WordPress","resourceBase":"\/****\/wp-content\/plugins\/civicrm\/civicrm\/"}};
    </script>
    <script type="text/javascript" src="/****/wp-content/plugins/civicrm/civicrm/packages/jquery/jquery-1.8.3.min.js?r=730aZ">
    </script>
    <script type="text/javascript" src="/****/wp-content/plugins/civicrm/civicrm/packages/jquery/jquery-ui-1.9.0/js/jquery-ui-1.9.0.custom.min.js?r=730aZ">
    </script>
    <script type="text/javascript" src="/****/wp-content/plugins/civicrm/civicrm/packages/jquery/plugins/jquery.autocomplete.js?r=730aZ">
    </script>
    <script type="text/javascript" src="/****/wp-content/plugins/civicrm/civicrm/packages/jquery/plugins/jquery.menu.pack.js?r=730aZ">
    </script>
    <script type="text/javascript" src="/****/wp-content/plugins/civicrm/civicrm/packages/jquery/plugins/jquery.chainedSelects.js?r=730aZ">
    </script>
    <script type="text/javascript" src="/****/wp-content/plugins/civicrm/civicrm/packages/jquery/plugins/jquery.tableHeader.js?r=730aZ">
    </script>
    <script type="text/javascript" src="/****/wp-content/plugins/civicrm/civicrm/packages/jquery/plugins/jquery.textarearesizer.js?r=730aZ">
    </script>
    <script type="text/javascript" src="/****/wp-content/plugins/civicrm/civicrm/packages/jquery/plugins/jquery.form.js?r=730aZ">
    </script>
    <script type="text/javascript" src="/****/wp-content/plugins/civicrm/civicrm/packages/jquery/plugins/jquery.tokeninput.js?r=730aZ">
    </script>
    <script type="text/javascript" src="/****/wp-content/plugins/civicrm/civicrm/packages/jquery/plugins/jquery.timeentry.pack.js?r=730aZ">
    </script>
    <script type="text/javascript" src="/****/wp-content/plugins/civicrm/civicrm/packages/jquery/plugins/jquery.mousewheel.pack.js?r=730aZ">
    </script>
    <script type="text/javascript" src="/****/wp-content/plugins/civicrm/civicrm/packages/jquery/plugins/DataTables/media/js/jquery.dataTables.min.js?r=730aZ">
    </script>
    <script type="text/javascript" src="/****/wp-content/plugins/civicrm/civicrm/packages/jquery/plugins/jquery.FormNavigate.js?r=730aZ">
    </script>
    <script type="text/javascript" src="/****/wp-content/plugins/civicrm/civicrm/packages/jquery/plugins/jquery.validate.min.js?r=730aZ">
    </script>
    <script type="text/javascript" src="/****/wp-content/plugins/civicrm/civicrm/packages/jquery/plugins/jquery.ui.datepicker.validation.pack.js?r=730aZ">
    </script>
    <script type="text/javascript" src="/****/wp-content/plugins/civicrm/civicrm/packages/jquery/plugins/jquery.jeditable.mini.js?r=730aZ">
    </script>
    <script type="text/javascript" src="/****/wp-content/plugins/civicrm/civicrm/packages/jquery/plugins/jquery.blockUI.js?r=730aZ">
    </script>
    <script type="text/javascript" src="/****/wp-content/plugins/civicrm/civicrm/packages/jquery/plugins/jquery.notify.min.js?r=730aZ">
    </script>
    <script type="text/javascript" src="/****/wp-content/plugins/civicrm/civicrm/packages/jquery/plugins/jquery.redirect.min.js?r=730aZ">
    </script>
    <script type="text/javascript" src="/****/wp-content/plugins/civicrm/civicrm/js/rest.js?r=730aZ">
    </script>
    <script type="text/javascript" src="/****/wp-content/plugins/civicrm/civicrm/js/Common.js?r=730aZ">
    </script>
    <script type="text/javascript" src="/****/wp-content/plugins/civicrm/civicrm/js/jquery/jquery.crmeditable.js?r=730aZ">
    </script>
    <script type="text/javascript" src="/****/wp-content/plugins/civicrm/civicrm/js/jquery/jquery.crmasmselect.js?r=730aZ">
    </script>
    <script type="text/javascript">
        CRM.url('init', '/****/?page=CiviCRM&q=civicrm/example&placeholder');
    </script>
    <link href="/****/wp-content/plugins/civicrm/civicrm/packages/jquery/css/jquery.autocomplete.css?r=730aZ" rel="stylesheet" type="text/css"/>
    <link href="/****/wp-content/plugins/civicrm/civicrm/packages/jquery/css/menu.css?r=730aZ" rel="stylesheet" type="text/css"/>
    <link href="/****/wp-content/plugins/civicrm/civicrm/packages/jquery/css/token-input-facebook.css?r=730aZ" rel="stylesheet" type="text/css"/>
    <link href="/****/wp-content/plugins/civicrm/civicrm/packages/jquery/jquery-ui-1.9.0/css/smoothness/jquery-ui-1.9.0.custom.min.css?r=730aZ" rel="stylesheet" type="text/css"/>
    <link href="/****/wp-content/plugins/civicrm/civicrm/packages/jquery/plugins/DataTables/media/css/demo_table_jui.css?r=730aZ" rel="stylesheet" type="text/css"/>
    <link href="/****/wp-content/plugins/civicrm/civicrm/css/civicrm.css?r=730aZ" rel="stylesheet" type="text/css"/>
    <link href="/****/wp-content/plugins/civicrm/civicrm/css/extras.css?r=730aZ" rel="stylesheet" type="text/css"/>
    <script type="text/javascript" src="/****/wp-content/plugins/civicrm/civicrm/js/noconflict.js?r=730aZ">
    </script>


Any help would be appreciated, thanks.
« Last Edit: August 02, 2013, 10:12:21 am by alexeightsix »

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: jQuery not working
August 03, 2013, 08:23:17 pm

i would compare the custom theme code to the default theme code. We inject all the headers via a hook

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

alexeightsix

  • I’m new here
  • *
  • Posts: 19
  • Karma: 0
  • CiviCRM version: 4.3
  • CMS version: 3.5.1
  • MySQL version: latest
  • PHP version: latest
Re: jQuery not working
August 04, 2013, 07:11:03 am
Which hook specifically? Thanks

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: jQuery not working
August 04, 2013, 07:45:40 am

check

civicrm_wp_head();

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

alexeightsix

  • I’m new here
  • *
  • Posts: 19
  • Karma: 0
  • CiviCRM version: 4.3
  • CMS version: 3.5.1
  • MySQL version: latest
  • PHP version: latest
Re: jQuery not working
August 05, 2013, 04:34:02 am
I've used that hook in my theme, what's strange is that it firs off on the form's second step but not the first. But when it fires off on the 2nd step it gets injected into the wrong div and the form POST url is wrong.

alexeightsix

  • I’m new here
  • *
  • Posts: 19
  • Karma: 0
  • CiviCRM version: 4.3
  • CMS version: 3.5.1
  • MySQL version: latest
  • PHP version: latest
Re: jQuery not working
August 05, 2013, 04:34:30 am
Quote from: alexeightsix on August 05, 2013, 04:34:02 am
I've used that hook in my theme, what's strange is that it fires off on the form's second step but not the first. But when it fires off on the 2nd step it gets injected into the wrong div and the form POST url is wrong.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Installing CiviCRM »
  • WordPress Installations (Moderators: Kurund Jalmi, Coleman Watts) »
  • jQuery not working

This forum was archived on 2017-11-26.