Я пытаюсь установить DataTable в свой код php, я уже связал два CDN с моей навигационной панелью, но это не сработает. В консоли есть три ошибки:
Uncaught ReferenceError: $ is not defined
at tables.php:279
(anonymous) @ tables.php:279
Chart.min.js:7
Uncaught TypeError: Cannot read property 'length' of null
at Object.acquireContext (Chart.min.js:7)
at Qe.construct (Chart.min.js:7)
at new Qe (Chart.min.js:7)
at chart-area-demo.js:32
acquireContext @ Chart.min.js:7
construct @ Chart.min.js:7
Qe @ Chart.min.js:7
(anonymous) @ chart-area-demo.js:32
Chart.min.js:7
Uncaught TypeError: Cannot read property 'length' of null
at Object.acquireContext (Chart.min.js:7)
at Qe.construct (Chart.min.js:7)
at new Qe (Chart.min.js:7)
at chart-pie-demo.js:7
, которые ссылаются на эту строку кода:
$(document).ready(function() {
кто-нибудь знает, как это исправить?
enter code here
<?php
include 'Nav-bar-upper.php';
?>
<script>
$(document).ready(function() {
$('#dataTable').DataTable();
} );
</script>
<!-- DataTales Example -->
<div class="card shadow mb-4">
<div class="card-header py-3">
<h6 class="m-0 font-weight-bold text-primary">DataTables Example</h6>
</div>
<div class="card-body">
<div class="table-responsive">
<table id="dataTable" class="table table-bordered " width="100%" cellspacing="0">
<thead>
<tr>
<th>Name</th>
<th>Position</th>
<th>Office</th>
<th>Age</th>
<th>Start date</th>
<th>Salary</th>
</tr>
</thead>
</table>
</div>
</div>
</div>
</div>
<?php
include 'Nav-bar-lower.php';
?>
/ /cdn.datatables.net/1.10.21/js/jquery.dataTables.min.js //cdn.datatables.net/1.10.21/css/jquery.dataTables.min.css
код из Nav-bar-upper. php:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="">
<meta name="author" content="">
<title>Expenses Tracker</title>
<!-- Custom fonts for this template-->
<link href="vendor/fontawesome-free/css/all.min.css" rel="stylesheet" type="text/css">
<link href="https://fonts.googleapis.com/css?family=Nunito:200,200i,300,300i,400,400i,600,600i,700,700i,800,800i,900,900i" rel="stylesheet">
<!-- Custom styles for this template-->
<link href="css/sb-admin-2.min.css" rel="stylesheet">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css">
<link href="https://fonts.googleapis.com/css?family=Montserrat" rel="stylesheet">
<link rel="stylesheet" href="css/input.css">
<!-- Table CDN -->
<link rel="stylesheet" href="https://cdn.datatables.net/1.10.21/css/jquery.dataTables.min.css">
код из Nav-bar-lower. php:
<!-- Bootstrap core JavaScript-->
<script src="vendor/jquery/jquery.min.js"></script>
<script src="vendor/bootstrap/js/bootstrap.bundle.min.js"></script>
<!-- Core plugin JavaScript-->
<script src="vendor/jquery-easing/jquery.easing.min.js"></script>
<!-- Custom scripts for all pages-->
<script src="js/sb-admin-2.min.js"></script>
<!-- Page level plugins -->
<script src="vendor/chart.js/Chart.min.js"></script>
<!-- Page level custom scripts -->
<script src="js/demo/chart-area-demo.js"></script>
<script src="js/demo/chart-pie-demo.js"></script>
<!-- Font Awesome Icons -->
<script src="https://use.fontawesome.com/b6676a21ac.js"></script>
<!-- Manual Input -->
<script src="https://code.jquery.com/jquery-3.2.1.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"></script>
<!-- Table CDN -->
<script src="https://cdn.datatables.net/1.10.21/js/jquery.dataTables.min.js"></script>
<script src="https://code.jquery.com/jquery-3.5.1.js"></script>
</body>
</html>