WordPress.org

Forums

Booking Calendar
[resolved] jQuery conflict? (11 posts)

  1. pdme
    Member
    Posted 1 year ago #

    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/

  2. wpdevelop
    Member
    Plugin Author

    Posted 1 year ago #

    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.

  3. pdme
    Member
    Posted 1 year ago #

    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!

  4. wpdevelop
    Member
    Plugin Author

    Posted 1 year ago #

    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.

  5. pdme
    Member
    Posted 1 year ago #

    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>

  6. wpdevelop
    Member
    Plugin Author

    Posted 1 year ago #

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

  7. pdme
    Member
    Posted 1 year ago #

    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)

  8. wpdevelop
    Member
    Plugin Author

    Posted 1 year ago #

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

  9. pdme
    Member
    Posted 1 year ago #

    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...

  10. pdme
    Member
    Posted 1 year ago #

    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...

  11. wpdevelop
    Member
    Plugin Author

    Posted 1 year ago #

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

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Booking Calendar
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic

Tags