Error jQuery not defined

Error jQuery not defined

ale123ale123 Posts: 4Questions: 0Answers: 0
edited September 2010 in General
Hi, again using dataTable, I m download the version 1.7.0, copy the jquery.dataTables.js y jquery.js into my project and import this js in my jsp. In my jsp I have a table and this code:


$(document).ready(function() {
$('#example').dataTable( {
"sPaginationType": "scrolling"
} );
} );





Browser
Platform(s)
Engine version
CSS grade




Internet
Explorer 4.0
Win 95+
4
X


Internet
Explorer 5.0
Win 95+
5
C




When I ' m show my page, this not show the elements to dataTables and in the browser's error console see an error that said, jQuery is not defined, in the jquery.dataTables.js.

How can resolve this problem? I need import other js? where is defined the variable jQuery that appaer in jquery.dataTables.js.?
Thanks.

Replies

  • cdaiglecdaigle Posts: 57Questions: 0Answers: 0
    Are you including the jquery.js file before the jquery.dataTables.js one?
    DataTables is a plugin for jQuery (the javascript library)




    ..Your Code here...
  • ale123ale123 Posts: 4Questions: 0Answers: 0
    Yes, I m including the jquery.js that download with dataTable in my page :
  • cdaiglecdaigle Posts: 57Questions: 0Answers: 0
    Aha there is the problem. As I mentioned, you need to load the jquery file _before_ dataTables.
    This is because the dataTables.js file needs to use what is in the jQuery.js file in order to load.

    So all you need to do is swap the order:




    Hope this helps
This discussion has been closed.