• A few years ago a friend downloaded some jquery development bundle files in order to use CF7 datepicker and made it work. I am afraid these files are a bit obsolete now. Can somebody help me and specify what I should do to replace the next files?

    Current situation:
    // JQUERY-HEADERS VOOR DE KALENDER
    echo ‘<script language=”JavaScript” type=”text/javascript” src=”https://www.magoster.nl/jquery-ui-1/development-bundle/ui/jquery.ui.core.js“></script>’;
    // –> jQueryUI datepicker
    echo ‘<script language=”JavaScript” type=”text/javascript” src=”https://www.magoster.nl/jquery-ui-1/development-bundle/ui/jquery.ui.datepicker.js“></script>’;

    Regards
    Rudolph Smits, NL

    The page I need help with: [log in to see the link]

Viewing 15 replies - 1 through 15 (of 17 total)
  • Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    What is obsolete exactly, what is the error you’re facing? The call to jQuery UI would have always been unnecessary as it is bundled with WordPress core.

    Thread Starter Rudolph Smits

    (@rudolph-smits)

    Andrew

    Let me introduce myself, I am an amateur who has learned a lot but for whom jquery has always remained a little “terra incognita”.

    I got a warning from Google:
    Uncaught TypeError: Cannot read property ‘regional’ of undefined
    https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/i18n/datepicker-nl.min.js?ver=1.11.4

    This is confusing because this https is NOT specified on the page with the code mentioned in the top here.

    Andrew, I cannot give more which is, I am afraid, to little.

    Or my question should be altered to: should I download new development bundle?
    But you said: the call to jQuery UI would have always been unnecessary as it is bundled with WordPress core. Is there a page where I can read more about this? Or is it enough to remove both echo’s <script .. etc. (top of this blog)?

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    I would recommend first debugging the error that is being thrown. It is true that your friend shouldn’t have called jQuery in this way, but until you understand the underlying issue you’re now facing I think switching the jQuery implementation would muddle things.

    When you say you got a warning from Google, where did you see that? I’m not seeing that particular error in Chrome.

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    I’m seeing a different error when I inspect your page using Chrome’s developer toolbars. What I think may have happened is jQuery core updated and removed a method and that method was probably also removed in jQuery UI – However you’re using an old version of jQuery UI that you say was implemented 2 years ago.

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    To test this, try editing your file:

    
    /jquery-ui-1/development-bundle/ui/jquery.ui.core.js
    

    And replacing all of its code with the code from this page: https://code.jquery.com/ui/1.12.0/jquery-ui.js

    Does the issue disappear? I’m assuming the issue is that your calendar doesn’t work properly.

    Thread Starter Rudolph Smits

    (@rudolph-smits)

    Thank you for giving so much support. But a new problem has arosen: my wife said “diner is ready”.

    I have to obey I am afraid… ??

    I will do as you suggested and report back later on.

    Regards
    Rudolph Smits

    Thread Starter Rudolph Smits

    (@rudolph-smits)

    I replaced:
    echo ‘<script language=”JavaScript” type=”text/javascript” src=”https://www.magoster.nl/jquery-ui-1/development-bundle/ui/jquery.ui.core.js“></script>’;
    with:
    echo ‘<script language=”JavaScript” type=”text/javascript” src=”https://code.jquery.com/ui/1.12.0/jquery-ui.js”></script>&#8217;;

    Or should I do more.

    Was that what you wanted me to do? The form now fails and gives a validation error (field not filled in but it does have a value!)

    By the way, I have an english site that is a look alike but that I treat as a testsite. This is the page that fails: https://www.magoster.com/booking-preparation/ with identical jquery scripts.

    To avoid a misunderstanding, the booking form works well. But that Google warning made me think that I am going to face problems in nearby future due to – supposed – obsolete software.

    But you said: the call to jQuery UI would have always been unnecessary as it is bundled with WordPress core. Shouldn’t I remove all my own jquery commands (echo etc.)?

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Let’s recap. What is the problem with your form?

    Thread Starter Rudolph Smits

    (@rudolph-smits)

    This is what happened:

    I got a message from Google Search Console what said that https://www.magoster.nl/blog-faq/blog-index/ had mobile usability problems. When I validated a solution I got the message “solved” but saw somewhere that warning for https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/i18n/datepicker-nl.min.js?ver=1.11.4. The warning said “Uncaught TypeError: Cannot read property ‘regional’ of undefined”.

    As datepicker was mentioned I went to my booking form pages and remembered that that developement bundle was already old. Earlyer this year I had tot update from PHP 5 tot PHP 7 being afraid for obsolete software. In the same line of thinking I thought that that development bundle could be the cause of that ajax warning. To avoid possible future problems I thought that using a newer development bundle could be a good idea, being the cause or not. And so I opened this topic.

    But you said: the call to jQuery UI would have always been unnecessary as it is bundled with WordPress core. Shouldn’t I remove all my own jquery commands (echo etc.)?

    Sorry if I have misled you, I was unaware of that!

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Yea let’s try calling jQuery UI correctly. Do you have a Child Theme setup? If not, set one up; https://developer.www.ads-software.com/themes/advanced-topics/child-themes/

    Then in your functions.php file, add this before the ?> characters:

    
    function add_jquery_ui() {
        wp_enqueue_script( 'jquery-ui-core' );
    }
    add_action( 'wp_enqueue_scripts', 'add_jquery_ui' );
    
    Thread Starter Rudolph Smits

    (@rudolph-smits)

    Andrew

    I am glad to meet you here again!

    I want to proceed with https://www.magoster.com, as said, more or less a test site.

    – I restored my previous jquery statements (as mentioned in the top of this blog)
    – current theme is Twenty Seventeen WITH user functions.php. But, just to be sure, it has a <head> and <body> part. Do I understand it well and should I add your function at the bottom of (the <body> part of) this file?

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    The function should only go inside of the file named “functions.php” of your Child theme – which should be set up before you do this.

    Thread Starter Rudolph Smits

    (@rudolph-smits)

    Right, done!

    Home and booking page do still show.
    Should I test something else now or ??

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    That’s the thing, because the symptom of the problem is just a report from Google saying there’s an error, all you need to do is check if google still reports the same error.

    Thread Starter Rudolph Smits

    (@rudolph-smits)

    Andrew, as an amateur I want to avoid problems caused by obsolete software while there is still time (= by updating in time). In this way you might have helped me already with this ajax-thing. Today I received an email from Google saying mobile usability problems have been solved so I cannot see anymore whether this ajax-issue is still at present or not. But I trust it is gone now.

    My original intention for this topic was (how) to get a more recent version of the jquery-software as mentioned in my echo-commands at the top.

    Earlyer you wrote: the call to jQuery UI would have always been unnecessary as it is bundled with WordPress core. Is it an idea that I open a new topic “Datepicker: how to make use of Jquery UI in WP-core?” or “Datepicker: how to avoid superflouos load of jquery-software” or something like that? You gave me the feeling that the jquery-scripts I’ve added are superflouos indeed.

    For this moment: thanks a lot for giving me so much time and attention, even when it stops here!

    Rudolph Smits
    Netherlands

Viewing 15 replies - 1 through 15 (of 17 total)
  • The topic ‘which jquery ui files to download’ is closed to new replies.