Hi. Newbie here can't get past first base ... why won't this work?

Hi. Newbie here can't get past first base ... why won't this work?

Bernard143Bernard143 Posts: 4Questions: 1Answers: 0

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Untitled Document</title>
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.21/css/jquery.dataTables.css">

</head>

<body>

Column 1 Column 2
Row 1 Data 1 Row 1 Data 2
Row 2 Data 1 Row 2 Data 2
$(document).ready( function () { $('#table_id').DataTable(); } );

</body>
</html>

This question has an accepted answers - jump to answer

Answers

  • tangerinetangerine Posts: 3,365Questions: 39Answers: 395

    I'm not seeing where you include jQuery and DataTables' js files.
    Starting with the documentation is a good idea.
    https://datatables.net/manual/installation

  • Bernard143Bernard143 Posts: 4Questions: 1Answers: 0

    Okay - that's because they didn't appear in my copy/paste - so this the actual page: http://rioserver.co.uk/datatables/

  • kthorngrenkthorngren Posts: 21,343Questions: 26Answers: 4,954

    The place to start is to look in the browser's console for errors. You have these errors:

    Uncaught ReferenceError: jQuery is not defined

    Uncaught ReferenceError: $ is not defined

    You aren't loading jquery.js. This is documented in the Dependancies Section of the docs Tangerine linked to. You can see this in the Zero Configuration example.

    Kevin

  • tangerinetangerine Posts: 3,365Questions: 39Answers: 395
    Answer ✓

    Your actual page still doesn't include jQuery js.

  • Bernard143Bernard143 Posts: 4Questions: 1Answers: 0

    Okay, I seem to have gotten off the first base! Thank you!

  • Bernard143Bernard143 Posts: 4Questions: 1Answers: 0

    So .. both kthorngren and tangerine gave me the solution. I'll say yes to tangerine but he/she replied first - but thank you kthorngren

This discussion has been closed.