[Newbie]TypeError: $(...).dataTable is not a function_I can't even use the example code on this site
[Newbie]TypeError: $(...).dataTable is not a function_I can't even use the example code on this site
![phasuksmit](https://secure.gravatar.com/avatar/93429da189972cb937c28401d9e7c131/?default=https%3A%2F%2Fvanillicon.com%2F93429da189972cb937c28401d9e7c131_200.png&rating=g&size=120)
What I'm I doing wrong ?
TypeError: $(...).dataTable is not a function
$('#tableID').dataTable();
test.php (line 28)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">
<title>MainLogin</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="css/bootstrap.min.css" rel="stylesheet">
<link href="css/bootstrap-responsive.min.css" rel="stylesheet">
<link href="css/bootstrap-theme.min.css" rel="stylesheet">
<script src="code.jquery.com/jquery-1.11.1.min.js"></script>
<script src="cdn.datatables.net/1.10.2/js/jquery.dataTables.min.js"></script>
<script src="js/jquery-1.11.1.min.js"></script>
<script src="js/bootstrap.min.js"></script>
</head>
<body>
</body>
</html>
Answers
You don't need jquery-1.11.1.min.js twice;
and your dataTable initialisation needs
<script></script>
tags.Also, where is your table's data coming from?
Actually I was put it on the code, but I wont show in this page anyway.
For table data, where can I put it on ?
... and
Can you tell me how to use DataTable in example ?
I'm newbie in web developing
I was read it for 2 full days and I dont know what to do in fundamental.
I try to do something easy and wait for it to show but never success :(
This is my code for now, no error shown in console. .... No anything shown up also.
* note that I put <_tag> instead of <tag> here
<_link rel="stylesheet" href="http://netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" />
<_link rel="stylesheet" href="http://netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap-theme.min.css" />
<_link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
<_link rel="stylesheet" href="//cdn.datatables.net/1.10.2/css/jquery.dataTables.min.css" />
<_script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<_script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<_script src="http://netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script>
<_script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
<_script type="text/javascript" src="//cdn.datatables.net/1.10.2/js/jquery.dataTables.min.js"></script>
</head>
<body>
<_script type="text/javascript">
var data = [
[
"Tiger Nixon",
"System Architect",
"Edinburgh",
"5421",
"2011/04/25",
"$3,120"
],
[
"Garrett Winters",
"Director",
"Edinburgh",
"8422",
"2011/07/25",
"$5,300"
]
]
$('#example').DataTable( {
data: data
} );
</script>
</body>
</html>