[newbie] table not working??

[newbie] table not working??

DoracDorac Posts: 3Questions: 0Answers: 0
edited June 2009 in General
Hey everyone im very new to jquery and datatables.

Here is my class.

this is in the header and both jquery and datatable scripts have been included

[code]

$(document).ready( function() {
$('#table_id').dataTable();
}




Column 1
Column 2
etc




Row 1 Data 1
Row 1 Data 2
etc


Row 2 Data 1
Row 2 Data 2
etc




[/code]

the "media" folder is also included and all links are linking properly.

i have no clue why this isnt working.

any help is appreciated.

thanks
Dorac

Replies

  • twistahtwistah Posts: 5Questions: 0Answers: 0
    edited June 2009
    You are missing some paranteces and the script block should be put inside some script tags.

    Like so:

    [code]

    $(document).ready( function() {
    $('#table_id').dataTable();
    });




    Column 1
    Column 2
    etc




    Row 1 Data 1
    Row 1 Data 2
    etc


    Row 2 Data 1
    Row 2 Data 2
    etc



    [/code]
  • DoracDorac Posts: 3Questions: 0Answers: 0
    edited June 2009
    Unfortunately thats not it. Those parts I cropped from a couple of pages. The parenteces you referred to wasn't needed from how my code is, I include a custom.js file that contains all my js for jquery. Here is the complete code with script parenteces etc and still not working.

    [code]










    $(document).ready( function() {
    $('#table_id').dataTable();
    });









    Column 1
    Column 2
    etc




    Row 1 Data 1
    Row 1 Data 2
    etc


    Row 2 Data 1
    Row 2 Data 2
    etc






    [/code]

    also please note the '.JS.' and '.CSS.' in my include paths are php code that includes just the path to the file.

    Still need help :(

    Thanks
  • twistahtwistah Posts: 5Questions: 0Answers: 0
    Dorac: then I would doublecheck your parths to the JS in the HEAD. The previous code that I've corrected worked for me.
  • DoracDorac Posts: 3Questions: 0Answers: 0
    07.
    08.

    LOL... jquery.js i spelt j"S"query.js

    Sorry guys. This was one really 2 hour waste of time cos of a spelling error.

    Thanks for all your help twistah
  • willawilla Posts: 1Questions: 0Answers: 0
    Well guys, If I may ask where do I put media folder?
This discussion has been closed.