Tagged: datatables, enfold, jQuery
-
AuthorPosts
-
June 5, 2018 at 9:10 pm #967485
What is the maximum version of jQuery that the Enfold theme (and it’s features) supports?
I’m using Enfold version 4.4.1 and am trying to utilize the DataTables library – https://www.datatables.net/manual/index
DataTables requires jQuery 1.7 or higher.When I change to jQuery 1.7, I get JavaScript errors with the menu. Specifically avia-snippet-megamenu.js?ver=4.4.1
Here is how I’m including the css/js:
wp_deregister_script(‘jquery’);
wp_register_script(‘jquery’, (“https://ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js”), false);
wp_enqueue_script(‘jquery’);wp_enqueue_style(‘datatables-css’, “https://cdn.datatables.net/1.10.16/css/jquery.dataTables.min.css”);
wp_register_script(‘datatables-js’, (“https://cdn.datatables.net/1.10.16/js/jquery.dataTables.min.js”), false);
wp_enqueue_script(‘datatables-js’);- This topic was modified 6 years, 5 months ago by Mitchell Adams. Reason: I meant to say "maximum"
June 8, 2018 at 1:19 am #969898Hey adamsml,
Thank you for using Enfold.
The jQuery version is 1.12.4 when I check. What are the errors when you load version 1.7? Please provide a link to the test page.
Best regards,
IsmaelJune 20, 2018 at 7:23 pm #975432I’ve included the link below.
June 20, 2018 at 8:04 pm #975448Hi,
Enfold uses the jquery version which is included with wordpress to avoid conflicts with other wordpress plugins and wordpress components. The latest stable wordpress version is 4.9.6 and includes jquery 1.12.4. Jquery 1.12.4 was released around two years ago: https://blog.jquery.com/2016/05/20/jquery-1-12-4-and-2-2-4-released/ whereas jquery 1.7 is older and was released in 2011: https://blog.jquery.com/2011/11/03/jquery-1-7-released/
So if DataTables library requires “jQuery 1.7 or higher” it should also work with recent versions like jquery 1.12.4. If it does not work with jquery 1.12.4 please contact the DataTables library developer. Enfold will not work with old jquery versions like jquery 1.7.
Best regards,
DudeJune 20, 2018 at 10:12 pm #975514Thanks Dude.
The DataTables JS was being loaded prior to jQuery. Adjusting the order fixed the issue.June 21, 2018 at 3:23 am #975615Hi,
Awesome! Glad we could help!
Please take a moment to review our theme and show your support https://themeforest.net/downloads
Don’t forget to bookmark Enfold Documentation for future reference.Thank you for using Enfold :)
Best regards,
Ismael -
AuthorPosts
- You must be logged in to reply to this topic.