catalinos
Forum Replies Created
-
Forum: Plugins
In reply to: [TablePress - Tables in WordPress made easy] DataTable is not a functionThanks! I’ll close the thread! Have a great day!
Forum: Plugins
In reply to: [TablePress - Tables in WordPress made easy] DataTable is not a functionLOL. It’s working!
The conclusion: the theme’s code was not right.
Thank you very much Tobias!
- This reply was modified 6 years, 7 months ago by catalinos.
Forum: Plugins
In reply to: [TablePress - Tables in WordPress made easy] DataTable is not a functionOK, I’ve removed the code then re-added the original one.
function reassign_jQuery() { wp_deregister_script( 'jquery' ); wp_deregister_script( 'jquery-core' ); // do not forget this wp_deregister_script( 'jquery-migrate' ); // do not forget this wp_register_script('jquery', 'https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js', array(), '1.12.4', TRUE ); wp_enqueue_script('jquery'); } if ( ! is_admin() ) add_action('init', 'reassign_jQuery');
This is the error I get:
Uncaught TypeError: $(...).dataTable is not a function at HTMLDocument.<anonymous> ((index):27) at i (jquery.min.js:2) at Object.fireWith [as resolveWith] (jquery.min.js:2) at Function.ready (jquery.min.js:2) at HTMLDocument.K (jquery.min.js:2)
You can test it here: https://antivirus.factsrider.com/best-internet-security-software/
Forum: Plugins
In reply to: [TablePress - Tables in WordPress made easy] DataTable is not a functionHi Tobias,
Wordpress comes with jQuery 1.12.4 by default. This is what I’ve added.
Thanks!
Forum: Plugins
In reply to: [TablePress - Tables in WordPress made easy] DataTable is not a functionNOTE: I’ve replaced the version of jquery from 1.8.1 to 1.12.4.
Forum: Plugins
In reply to: [TablePress - Tables in WordPress made easy] DataTable is not a functionHello,
Do you have an alternative to it? If I remove the code, the error will return.
NOTE: The initial code was this one (not working):
function reassign_jQuery() {
wp_deregister_script( ‘jquery’ );
wp_deregister_script( ‘jquery-core’ ); // do not forget this
wp_deregister_script( ‘jquery-migrate’ ); // do not forget thiswp_register_script(‘jquery’, ‘https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js’, array(), ‘1.12.4’, TRUE );
wp_enqueue_script(‘jquery’);
}
if ( ! is_admin() )
add_action(‘init’, ‘reassign_jQuery’);Thanks!
Forum: Plugins
In reply to: [TablePress - Tables in WordPress made easy] DataTable is not a functionI enabled/disabled all the plugins: the issue still present.
I’ve activated the default theme: the same issue.
Finally, I’ve solved the problem using this code in the functions.php file
function my_init()
{
if (!is_admin())
{
wp_deregister_script(‘jquery’);// Load a copy of jQuery from the Google API CDN
// The last parameter set to TRUE states that it should be loaded
// in the footer.
wp_register_script(‘jquery’, ‘https://ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js’, FALSE, ‘1.8.1’, TRUE);wp_enqueue_script(‘jquery’);
}
}
add_action(‘init’, ‘my_init’);Thank you!
Forum: Plugins
In reply to: [TablePress - Tables in WordPress made easy] DataTable is not a functionThe error with the “jQuery Updater” disabled.
Uncaught TypeError: $(…).dataTable is not a function
at HTMLDocument.<anonymous> (antivirusprotection.reviews/:29)
at i (jquery.min.js:2)
at Object.fireWith [as resolveWith] (jquery.min.js:2)
at Function.ready (jquery.min.js:2)
at HTMLDocument.K (jquery.min.js:2)Forum: Plugins
In reply to: [TablePress - Tables in WordPress made easy] DataTable is not a functionWhen Autoptimizer is disabled I receive this error:
jquery-3.3.1.min.js?ver=3.3.1:2 Uncaught TypeError: $(…).dataTable is not a function
at HTMLDocument.<anonymous> ((index):546)
at l (jquery-3.3.1.min.js?ver=3.3.1:2)
at c (jquery-3.3.1.min.js?ver=3.3.1:2)- This reply was modified 6 years, 7 months ago by catalinos.
Forum: Plugins
In reply to: [TablePress - Tables in WordPress made easy] DataTable is not a functionIf I choose to ignore that folder and its files I receive an additional problem:
Uncaught TypeError: $(…).dataTable is not a function
at HTMLDocument.<anonymous> ((index):29)
at l (jquery-3.3.1.min.js:2)
at c (jquery-3.3.1.min.js:2)If I choose to also optimize the both files the error I receive is this one:
Uncaught ReferenceError: jQuery is not defined at (index):28
Forum: Plugins
In reply to: [TablePress - Tables in WordPress made easy] DataTable is not a functionI’ve concatenated the local jquery files and the first error disappeared.
Now I have this code:
<script type=”text/javascript”>jQuery(document).ready(function($){
$(‘#tablepress-1’).dataTable({“stripeClasses”:[],”ordering”:false,”paging”:false,”searching”:false,”info”:false,”scrollX”:true});
});</script>And this error:
Uncaught ReferenceError: jQuery is not defined at (index):28
Forum: Plugins
In reply to: [TablePress - Tables in WordPress made easy] DataTable is not a functionHi,
Thank you for the fast reply.
Is this the .js file which should be loaded: jquery.datatables.min.js ?
I use Autoptimize plugin: https://www.ads-software.com/plugins/autoptimize/ which probably concatenate this file too.
Regarding the files loaded from Google CDN: I’ve updated the file with the latest version. The file is not loaded externally now.
Thanks!
LE: I’ve activated/deactivated the Autoptimize plugin, but the error persists.
- This reply was modified 6 years, 7 months ago by catalinos.