I want to initialize my DataTables, I already downloaded it, call it, and everything seems okay, but when I call the JQuery function to run the datatables it gives me this weird error.
TypeError: $ is not a function
But my code seems okay:
$(document).ready( function () {
$('#table_id').DataTable();
} );
THis is my HTML:
<table id="table_id" class="display">
<thead>
<tr>
<th>Column 1</th>
<th>Column 2</th>
</tr>
</thead>
<tbody>
<tr>
<td>Row 1 Data 1</td>
<td>Row 1 Data 2</td>
</tr>
<tr>
<td>Row 2 Data 1</td>
<td>Row 2 Data 2</td>
</tr>
</tbody>
What can this be?
Script order:
<script src="<?php echo base_url('assets2/js/vendor/jquery-2.1.4.min.js');?>"></script> <script src="<?php echo base_url('assets/js/datatables.min.js');?>"></script> <script src="<?php echo base_url('assets/js/Backoffice_JS.js');?>"></script>