Issue with datatable js
-
Hi, I have enqueued datatable library with a function, I have excluded script ‘jquery.dataTables.min.js’ on plugin’ settings but on site’s page I receive this error: ‘jQuery(…).DataTable is not a function’, if i disable plugin this error not appears.
Could you help me? Thanks
add_action( ‘wp_enqueue_scripts’, ‘datatable_scripts’, 10 );
function datatable_scripts() {
wp_enqueue_style(‘jquery-datatables-css’,’https://cdn.datatables.net/1.10.23/css/jquery.dataTables.min.css’);
wp_enqueue_script(‘jquery-datatables-js’,’https://cdn.datatables.net/1.10.23/js/jquery.dataTables.min.js’,array(‘jquery’));wp_enqueue_style(‘jquery-datatables-responsicecss’,’https://cdn.datatables.net/responsive/2.2.7/css/responsive.dataTables.min.css’);
wp_enqueue_script(‘jquery-datatables-responsivejs’,’https://cdn.datatables.net/responsive/2.2.7/js/dataTables.responsive.min.js’,array(‘jquery-datatables-js’));}
- The topic ‘Issue with datatable js’ is closed to new replies.