Jump to content
Larry Ullman's Book Forums

Simple Problem With "js/jquery.datatables.min.js" (Datatables Plug-In)


Recommended Posts

Hi,

 

In chapter 13 there is an example of using the DataTables plugin - in folder ch13 there is table.html.

 

In that .html file there is: <script src="js/jquery.dataTables.min.js"></script>, but in js folder there is no that file. So, I downloaded the DataTables from http://datatables.net/download/, and in folder DataTables-1.10.0\media\js there is that file, so I just copied it (jquery.dataTables.min.js) to js folder of that example (ch13\js), but it doesn't work again :/

 

Do you know what could be the problem?

 

Also, I have another question - according to the documentation: http://datatables.net/manual/installation - to use DataTables we need to include DataTables on your page using the following HTML:

 

<!-- DataTables CSS -->
<link rel="stylesheet" type="text/css" href="/DataTables-1.10.0/css/jquery.dataTables.css">
 
<!-- jQuery -->
<script type="text/javascript" charset="utf8" src="/DataTables-1.10.0/js/jquery.js"></script>
 
<!-- DataTables -->
<script type="text/javascript" charset="utf8" src="/DataTables-1.10.0/js/jquery.dataTables.js"></script>

 

But in the example tables.html (ch13) there CSS included is:

 

<link rel="stylesheet" href="css/demo_table_jui.css">

 

 

and JavaScript included:

 

 

    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
    <script src="js/jquery.dataTables.min.js"></script>

 

... which is different than in the documentation. Does this mean that I do not need to include CSS file jquery.dataTables.css as in documentation?

 

 

EDIT: I also tested version of table.html with includes as it is explained in the documentation, but it still doesn't work :/

Link to comment
Share on other sites

The CSS file will simply "pretty up" stuff, and likely not affect the functionality.

With that said, pull open your browser console and look for any errors that might be getting output.

Likely, your either aren't putting the file(s) in the right place, or you are not correctly referencing the objects/functions in the library.

 

Without more info, it's hard to help though.

Thanks.

  • Upvote 1
Link to comment
Share on other sites

Hi HartleySan,

 

Sorry for the late reply. I was looking at code and I can't find what is the problem. I will upload original files from ch13 (also available here), and the same files but with added jquery.dataTables.min.js in js directory.

 

1. Original (from larryullman.com & wihtout jquery.dataTables.min.js in js directory) - http://download1348.mediafire.com/k8eh0h0n78wg/hpe52nx7c4d52qp/ch13.zip

 

2. With jquery.dataTables.min.js in js directory - http://download1072.mediafire.com/2rr2ohn9d3jg/0890rotur5egm89/withJS.zip

 

This is not an emergency, when you have a lot of free time and will - you can check this  :)  And, sorry for my bad English.

Thanks.

Link to comment
Share on other sites

 Share

×
×
  • Create New...