My jSON response works good at localhost but in server throws error.

My jSON response works good at localhost but in server throws error.

manigopalmanigopal Posts: 11Questions: 3Answers: 0

At localhost it works fine but at server hosted.,

DataTables warning: table id=user_data - Invalid JSON response. For more information about this error, please see http://datatables.net/tn/1

Hosted URL : http://basicajaxcrud.22web.org/

Answers

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    Have you followed the diagnostic steps shown in the error? I just did, and it shows the Ajax response from fetch.php is empty - which is indeed an invalid JSON response. You'll need to check the server scripts to determine why that is happening.

    Colin

  • swapnilj1993swapnilj1993 Posts: 1Questions: 0Answers: 0
    edited November 2020

    Hi Colin
    Even I'm too facing the same issue .
    Its working fine with other DB environments but I'm facing problem with prod Db alone.

    But the interesting part is the issue gets fixed automatically on its own in 3 or days .after some time it emerges again .

    Could you please suggest

    Thanks,
    Swapnil

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    As with the OP, the key is to follow the diagnostic steps. If it's failing intermittently, then the issue will be with the server - so it would be worth checking logs there and comparing the output on the good and bad days,

    Colin

This discussion has been closed.