WordPress.org

Support

Support » Plugins and Hacks » [Resolved] jQuery conflict?

[Resolved] jQuery conflict?

  • I’m applying some jQuery to some of the <td> classes in the calendar.

    It works only if I load the jQuery in the footer. And it stops working after I click to see more months, later in the year.

    I guess there is some sort of jQuery conflict, but I can’t seem to find how to solve it exactly. I’ve tried ,noConflict() et cetera, but all to no avail.

    Any thoughts?

    http://wordpress.org/extend/plugins/booking/

Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Author wpdevelop

    @wpdevelop

    Hello.
    It’s seems that you are just have some JavaScript errors.
    Please check in your browser (developer tools) the type of that JavaScript error(s) and then try to fix them.
    Please note, if you will modify (or already did it) the source code of the Booking Calendar, we will not guaranteed the correct work of plugin and do not support it.

    ok, stupid question: how exactly do I use the developer tools to check for JS errors?

    ps. I haven’t modified the source code in any way

    pss. thanks for your quick reply!

    Plugin Author wpdevelop

    @wpdevelop

    Hello.
    If you are using the Firefox browser you can check how to check it here .
    In the Google Chrome and in Safari browsers you can check it by finding somewhere in tool menus.

    it shows me no errors. this is the jQuery I added in the footer, right before </body>

    <script>

    $(document).ready(function(){
    $(‘.date_approved, .date2approve’).on(‘mouseenter’, function(){
    $(‘#booking_info’).fadeIn(100);
    $x=$(this).attr(‘class’).match(/[\d]+-[\d]+-[\d]+/);
    $(‘#booking_info’).text(booking_info[$x]);
    });
    $(‘.date_approved, .date2approve’).on(‘mouseleave’, function(){
    $(‘#booking_info’).fadeOut(100);
    });
    });

    </script>

    Plugin Author wpdevelop

    @wpdevelop

    Can you send the link to the site, so I will recheck it later during today?
    Kind regards.

    not really, since it’s a password-protected site for a family who wants to keep it that way.

    wait, I had this loaded in the functions.php (TwentyTwelve), to avoid conflicts (found on CSS Tricks):

    if (!is_admin()) add_action("wp_enqueue_scripts", "my_jquery_enqueue", 11);
    function my_jquery_enqueue() {
       wp_deregister_script('jquery');
       wp_register_script('jquery', "http" . ($_SERVER['SERVER_PORT'] == 443 ? "s" : "") . "://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js", false, null);
       wp_enqueue_script('jquery');
    }

    [Please post code & markup between backticks or use the code button. Your posted code may now have been permanently damaged by the forum’s parser.]

    after deleting this, I get this error message twice in the console:

    Uncaught TypeError: Property ‘$’ of object [object Object] is not a function localhost/:291
    (anonymous function)

    Plugin Author wpdevelop

    @wpdevelop

    Its seems like you have wrong calling of the jQuery.
    Please use instead of the “$” the “jQuery” in your scripts.

    Tried that, but no success.

    According to the console, the the browser stops calling the whole function (the one I added) after clicking to see later months…

    Ok, so I solved the problem, but only by modifying the datepick.jquery.js file. I added my jQuery at the end of the _adjustDate function, the one that is called when clicking to see more months. And now it works…

    Plugin Author wpdevelop

    @wpdevelop

    Ok, good to know that its works now.
    Kind regards.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘[Resolved] jQuery conflict?’ is closed to new replies.