Support

Home Forums Event Espresso Premium jquery confict with latest version

jquery confict with latest version

Posted: October 23, 2013 at 4:46 am

Viewing 5 reply threads


Tzoanna Ioannidou

    October 23, 2013 at 4:46 am

    Hi I just updated to the latest version and some aspects of my site that use jquery no longer work (while they used to have no problem – and work just fine with event espresso deactivated).

    I am calling this in the header to make some boxes appear on click:

    <script src=”http://code.jquery.com/jquery-latest.js”></script&gt;
    <!– about us boxes –>
    < script>
    function showonlyone(thechosenone) {
    $(‘div[name|=”aboutboxes”]’).each(function(index) {
    if ($(this).attr(“id”) == thechosenone) {
    $(this).fadeIn();
    }
    else {
    $(this).fadeOut();
    }
    });
    }
    </ script>

    Can you tell me where the problem with the plugin may be?


    Dean

    • Support Staff

    October 23, 2013 at 5:05 am

    Hi,

    Its hard to say without seeing the site to check for errors (a link would be great!), but it might be that you are using a version of jQuery not supplied with WordPress (not advised) and that the script is using the short form of jQuery ($). Often when errors occur and the shortform is in use, it is due to the shortform not being called correctly.

    As mentioned without seeing the site the above is guesswork.


    Tzoanna Ioannidou

      October 23, 2013 at 5:10 am

      Thanks for the quick response :)

      The site is not online atm, so I would have to give you an account to see it. I am calling the latest jquery in header.php, does the new wordpress also call it maybe?

      indeed it gives an error in the console: Uncaught TypeError: Property ‘$’ of object [object Object] is not a function

      <script>
      function showonlyone(thechosenone) {
      $(‘div[name|=”aboutboxes”]’).each(function(index) {
      if ($(this).attr(“id”) == thechosenone) {
      $(this).fadeIn();
      }
      else {
      $(this).fadeOut();
      }
      });
      }
      </script>


      Dean

      • Support Staff

      October 23, 2013 at 5:19 am

      The latest WordPress calls jQuery 1.10.2.

      Ok, there’s the answer

      ‘$’ of object [object Object]

      means that you are using $ but have you or whoever wrote the code, has not correctly placed jQuery in no conflict mode – http://digwp.com/2011/09/using-instead-of-jquery-in-wordpress/


      Tzoanna Ioannidou

        October 23, 2013 at 5:27 am

        Thank you so much! this fixed the problem :)


        Dean

        • Support Staff

        October 23, 2013 at 5:32 am

        You’re welcome!

        If you get time, please consider sharing your experiences – http://staging.eventespresso.com/about/help-us-help-you-how-to-share-event-espresso/

        Viewing 5 reply threads

        The support post ‘jquery confict with latest version’ is closed to new replies.

        Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

        Event Espresso - Staging Server