• Resolved gRaViJa

    (@gravija)


    Hey,

    The calendar stops working (keeps loading) as soon as I want to load the jQuery and jQuery UI libs:

    <script src=”https://code.jquery.com/jquery-3.2.1.js”></script&gt;
    <script src=”https://code.jquery.com/ui/1.12.1/jquery-ui.js”></script&gt;

    As soon as I remove these, the calendar loads normally. I tried loading the libs and the footer or with the defer tag, but the problems persists.

    I also turned off the frontend loading of bootstrap and js with the plugin options, but still the same. I also checked for JS errors, and there’s a lot of warnings there but only one or two errors, not sure if any of hem has to do with this problem.

    The calendar probably uses jQuery too, but when i don’t load the libs myself, the other objects using jQuery don’t work.

    I really hope someone has a solution, i’m on a tight deadline :/

    Thanks!

    • This topic was modified 7 years ago by gRaViJa.

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

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

    (@wpdevelop)

    Hello.
    This issue relative to loading of jQuery library second time at the bottom of the page.
    Firstly plugin is loading jQuery library from Standard WordPress installation at header, and later your theme (or other plugin) is load jQuery second time, and all previously defined jQuery variables become undefined, its generate JavaScript error and calendar is not showing. Please check more about this here: https://wpbookingcalendar.com/faq/loading-jquery-twice/

    You need to disable of loading jQuery second time.
    Kind Regards.

    Thread Starter gRaViJa

    (@gravija)

    Hi,

    You mean the calendar plugin loads it too or some other plugin?

    If so, I currently need to load the jQuery a second time, else other functions I really need on this page don’t work. if I can use the jQeury loaded from the calendar plugin for other things too, then my problem is fixed, but how? Or is there a better solution?

    Edit: there are no references to jquery in my header.php, i did add it myself on the page for other page functions.

    • This reply was modified 7 years ago by gRaViJa.
    Plugin Author wpdevelop

    (@wpdevelop)

    Hello.
    Yes, the plugin is load jQuery library. If you check your page it’s at header of the page.
    You need to disable load jQuery second time. But you can still load jQuery UI library (second script).

    You can check here how correctly to load JavaScript files in plugins or themes in WordPress https://www.wpbeginner.com/wp-tutorials/how-to-properly-add-javascripts-and-styles-in-wordpress/

    Kind Regards.

    • This reply was modified 7 years ago by wpdevelop.
    Thread Starter gRaViJa

    (@gravija)

    Thank you for your fast answers! I tried that, but when i try to load jqueryui only, the dateickers still dont work, so it really seems like i have to load it a second time for it to load. There isnt a way to make the first loading of jquery work for both somehow?

    Ill look into it more myself as well. I hope we find an answer ??

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Calendar not loading when Loading jQuery lib’ is closed to new replies.