DataTables warning (table id = 'example'): DataTables warning: JSON data from server could not be
DataTables warning (table id = 'example'): DataTables warning: JSON data from server could not be
Allan,
"editor" was purchased and it was installed, the following message appears.
DataTables warning (table id = 'example'): DataTables warning: JSON data from server could not be
parsed. This is caused by a JSON formatting error.
The version of PHP was 5.3.12 although he thought whether to have been a version of php.
"editor" uses 1.2.3 and "datatables" uses 1.9.4.
It installs with a setup of the following sites and has not changed other than config.php.
http://editor.datatables.net/tutorials/installing
Please teach me how to avoid an error.
Regards,
iijima
"editor" was purchased and it was installed, the following message appears.
DataTables warning (table id = 'example'): DataTables warning: JSON data from server could not be
parsed. This is caused by a JSON formatting error.
The version of PHP was 5.3.12 although he thought whether to have been a version of php.
"editor" uses 1.2.3 and "datatables" uses 1.9.4.
It installs with a setup of the following sites and has not changed other than config.php.
http://editor.datatables.net/tutorials/installing
Please teach me how to avoid an error.
Regards,
iijima
This discussion has been closed.
Replies
There are a number of things that can cause this error, from invalid PHP to incorrect database access, and from PHP versions to database fields.
Fundamentally we need to know what is being returned from the server, instead of valid JSON to be able help resolve the issue. You can find this out using the developer tools in Chrome / Safari or Firebug in Firefox (to look at the XHR return from the server). What is being returned from the server? It likely contains an error message.
Allan
I have exactly the same situation, the XHR return is the following:
<?php
/*
* Example PHP implementation used for the index.html example
*/
// DataTables PHP library
include( "lib/DataTables.php" );
// Alias Editor classes so they are easy to use
use
DataTables\Editor,
DataTables\Editor\Field,
DataTables\Editor\Format,
DataTables\Editor\Join,
DataTables\Editor\Validate;
// Build our Editor instance and process the data coming from _POST
Editor::inst( $db, 'browsers' )
->fields(
Field::inst( 'engine' )->validator( 'Validate::required' ),
Field::inst( 'browser' )->validator( 'Validate::required' ),
Field::inst( 'platform' ),
Field::inst( 'version' ),
Field::inst( 'grade' )->validator( 'Validate::required' )
)
->process( $_POST )
->json();
please. could you help me with this, it's driving me crazy
Jane
Please post a link to a test case showing the problem: http://datatables.net/forums/discussion/12899/post-test-cases-when-asking-for-help-please-read . Failing that, please use the debugger so I can see what might be happening.
Allan