Unable to run server-side examples

Unable to run server-side examples

kelekeliokelekelio Posts: 3Questions: 1Answers: 0
edited August 2015 in Free community support

Hello,

I have been having some troubles running server-side processing examples.
They always return this error:
"DataTables warning: table id=example - Invalid JSON response. For more information about this error, please see http://datatables.net/tn/1"

this is the example http://serwer1530566.home.pl/DataTables/examples/server_side/simple.html

What the script returns http://serwer1530566.home.pl/DataTables/examples/server_side/scripts/server_processing.php

and here is the debug http://debug.datatables.net/oxiluj

I even saved the server output as 1.ajax and made this file the source
http://serwer1530566.home.pl/DataTables/examples/server_side/simplecopy.html
and for some reason that kinda worked.

Any ideas?

Replies

  • tangerinetangerine Posts: 3,365Questions: 39Answers: 395

    If you check your console output from http://serwer1530566.home.pl/DataTables/examples/server_side/simple.html you will see there is some Javascript tagged on to the end of your Json data - hence "Invalid JSON response".

  • kelekeliokelekelio Posts: 3Questions: 1Answers: 0

    yup.. my server was gathering some statistics by default. It's working now, thanks :D

  • allanallan Posts: 63,700Questions: 1Answers: 10,502 Site admin

    The debug code shows that the JSON data is indeed not valid (as the instructions in tech note 1 would show you how to confirm). The JSON data looks good, un to the point where it includes:

    < script type = "text/javascript" > <!--
    document.writeln('<' + 'scr' + 'ipt type="text/javascript" src="http://home.hit.stat24.com/_' + (new Date()).getTime() + '/script.js?id=Affg7asFYxcruT3b49L9.qQsTKj6CcSUj.DNL.RcY_z.r7"></' + 'scr' + 'ipt>');
    //-></script>
    

    which is of course not valid JSON.

    Having said that, your link appears to work now, so I'm guess your've resolve this?

    Allan

This discussion has been closed.