DataTables not displaying CakePHP JSON table data
DataTables not displaying CakePHP JSON table data
I'm working on a new application, using CakePHP to produce the JSON data for DataTables, but am unable to get DataTables to display the data.
Source of the data is : http://wwwtest.registrar.wisc.edu/Posts/datatable
That data passes JSON validation.
If I copy the text from that page, and put it in to a new text file, http://wwwtest.registrar.wisc.edu/test_array.txt, DataTables is able to correctly parse/display the data.
Test page is located here: http://wwwtest.registrar.wisc.edu/DT_Test.htm
JavaScript is:
[code]
$(document).ready(function() {
$('#post_data').dataTable( {
"sAjaxSource": "/Posts/datatable"
} );
} );
[/code]
I'm sure I'm missing something simple, but just can't see what it is.
Any suggestions on why DataTables is not able to work with the CakePHP produced JSON?
Does anyone have the source for a CakePHP app that they have working that they woudl be willing to share?
Thanks
Jim
Source of the data is : http://wwwtest.registrar.wisc.edu/Posts/datatable
That data passes JSON validation.
If I copy the text from that page, and put it in to a new text file, http://wwwtest.registrar.wisc.edu/test_array.txt, DataTables is able to correctly parse/display the data.
Test page is located here: http://wwwtest.registrar.wisc.edu/DT_Test.htm
JavaScript is:
[code]
$(document).ready(function() {
$('#post_data').dataTable( {
"sAjaxSource": "/Posts/datatable"
} );
} );
[/code]
I'm sure I'm missing something simple, but just can't see what it is.
Any suggestions on why DataTables is not able to work with the CakePHP produced JSON?
Does anyone have the source for a CakePHP app that they have working that they woudl be willing to share?
Thanks
Jim
This discussion has been closed.
Replies
Posts/datatable?_=1333127990078
Failed to load resource: the server responded with a status of 500 (Internal Server Error)
[/quote]
That's not going to help. Have a look in your server's error logs.
Allan
Thanks for the quick reply!
That page loads fine for me, I checked it in multiple browsers/computers.
Also, was there a reason it had a parameter "?_=1333127990078" when you tried it??
I did check the error log, no error.
Thanks
Jim
> Also, was there a reason it had a parameter "?_=1333127990078" when you tried it??
That's the jQuery anti-cache parameter - http://jqapi.com/#p=jQuery.ajax
Allan