Cannot get this to work. I've tried everything I can think of!

Cannot get this to work. I've tried everything I can think of!

nickelmedianickelmedia Posts: 12Questions: 0Answers: 0
edited December 2012 in General
I'm trying to install and get this working at all. I've read about a dozen forum threads asking for help and none seem to work for me. It seems so easy to install this but it's not working at all.

My dev URL is http://utrip.pickorange.com/event-list/

I've tried the debugger and it doesn't sense DataTables at all.

Here are the pieces of my output code that are related to datatables:

[code]



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

[/code]

[code]



Date
Event
Location
Age Groups





02/08/13
UFC VI - Altamonte Springs
Seminole Softball Complex
8U 11U 9U



02/22/13
North Florida Super NIT
Southside Recreation Complex




[/code]

This is a wordpress install if that matters. I even copy pasted your example table into the file which also did not work. Can anyone help?

Replies

  • essexstephessexsteph Posts: 57Questions: 0Answers: 0
    A quick look at your test url gives 2 javascript errors:

    Uncaught ReferenceError: jQuery is not defined
    Uncaught ReferenceError: $ is not defined

    Looking at the source - it looks like jquery itself is loaded after datatables - try loading it before.
  • nickelmedianickelmedia Posts: 12Questions: 0Answers: 0
    Switched it around, but still no luck.
  • essexstephessexsteph Posts: 57Questions: 0Answers: 0
    OK, you're still getting a javascript error. I took your table and pasted it into the live test site:

    http://live.datatables.net/izuwub/4/edit#preview

    ... and it works. However I notice that you are missing a for each of the hyperlinks in the event column.

    So, something non-datatable-related on your page is stopping it from working.
  • psmerdpsmerd Posts: 9Questions: 0Answers: 0
    Try moving all into the , and put the $(document)... last
  • nickelmedianickelmedia Posts: 12Questions: 0Answers: 0
    Tried all of the above and thank you essexsteph for validating the table. I didn't know that test site existed.

    Still not working. I only see one error in FireBug:

    ReferenceError: $ is not defined
    [Break On This Error]

    $(document).ready(function() {

    I also loaded a plugin to replace the theme jquery file with Google's file so I don't think it's a corrupted jquery file. Could another JS being loaded cause a conflict?
  • allanallan Posts: 63,389Questions: 1Answers: 10,450 Site admin
    Please link to a test case: http://datatables.net/forums/discussion/12899/post-test-cases-when-asking-for-help-please-read .

    Yes - it sounds like a conflict. Try using `jQuery` .
  • nickelmedianickelmedia Posts: 12Questions: 0Answers: 0
    I've solved the problem. There were two .js files loading with another plugin that were causing errors. I found them by deleting other .js scripts one at a time. I was also using a google CDN plugin which added the script [code]try{jQuery.noConflict();}catch(e){};[/code] and dataTables didn't like that. I changed to a different CDN and it's now working fine!

    Thanks for the help everyone.
This discussion has been closed.