DataTables warning: table id - Invalid JSON response.

DataTables warning: table id - Invalid JSON response.

sbinmahfoozsbinmahfooz Posts: 9Questions: 4Answers: 0

Hi, i have installed and used the DataTables editor, the examples are working OK, but when i am trying to use for my own application i am getting the following error after checking the resources section in Safari
Warning: include(localhost/thebaker/editor/php/DataTables.php) [<a href='function.include'>function.include</a>]: failed to open stream: No such file or directory in <b>/Applications/AMPPS/www/TheBaker/wp-content/themes/avada/scripts/tb_weekly_plans_details_populated.php <--- this is my server side script

<b>Fatal error</b>: Class 'DataTables\Editor' not found in <b>/Applications/AMPPS/www/TheBaker/wp-content/themes/avada/scripts/tb_weekly_plans_details_populated.php</b> on line <b>12</b><br />

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,464Questions: 1Answers: 10,466 Site admin

    Sounds like the paths have gone funny somewhere. What is the inline line for DataTables.php you are using?

    Allan

  • sbinmahfoozsbinmahfooz Posts: 9Questions: 4Answers: 0

    it is the same standard file the plugin provided -- i have changed nothing

    define("DATATABLES", true, true);

    check version if condition

    include( dirname(FILE).'/Bootstrap.php' );

  • allanallan Posts: 63,464Questions: 1Answers: 10,466 Site admin

    I meant the include statement in the tb_weekly_plans_details_populated.php file.

    Allan

  • sbinmahfoozsbinmahfooz Posts: 9Questions: 4Answers: 0
    include( "localhost/thebaker/editor/php/DataTables.php" );
    
  • allanallan Posts: 63,464Questions: 1Answers: 10,466 Site admin
    Answer ✓

    That looks like it should be:

    include( $_SERVER['DOCUMENT_ROOT']."/editor/php/DataTables.php" );
    

    Otherwise it is trying to go down a path called localhost from the current directory, which I doubt exists.

    Allan

  • sbinmahfoozsbinmahfooz Posts: 9Questions: 4Answers: 0

    it worked out, i moved the folder to a to the root location and not under my website, now in order to access the examples, i have to link localhost/editor/examples instead of localhost/thebaker/editor/examples

    thanks

This discussion has been closed.