AJAX Source Troubleshooting

AJAX Source Troubleshooting

gstephensgstephens Posts: 2Questions: 0Answers: 0
edited June 2011 in General
I'm new to datatables and javascript. I having a working server side datatable that I want to change to an AJAX source. I've taken the JSON that I had loaded on the server side written it to a file and changed the bProcessing & sAjaxSource entries from:

bServerSide: true,
sAjaxSource: '${request.contextPath + '/app/appJSONTable'}' ,

to

bProcessing: true,
sAjaxSource: '/home/greg/Temp/data.json' ,

I have also upgraded from 1.7.6 to 1.8.0. Under 1.7.6 I received the error "No Data Available in Table". After upgrading, it now says "Loading...".

I'm guessing that it can't find the file. How should I approach troubleshooting this?

Replies

  • allanallan Posts: 63,523Questions: 1Answers: 10,473 Site admin
    Use Firebug to look at the XHR and the payload which is coming back from the server. Run the JSON data through http://jsonlint.com to make sure it is valid.

    Allan
  • gstephensgstephens Posts: 2Questions: 0Answers: 0
    jsonlint.com validates the JSON data in the file. Firebug shows an empty table body:

    Loading...
This discussion has been closed.