We have the infamous "Invalid JSON response" problem. One of the messages:
DataTables warning: table id=table_13 - Invalid JSON response. For more information about this error, please see http://datatables.net/tn/1
But the table_13 is no long existed. All similar messages show nonexistent tables. During the development I remove several tables, but they come back again to haunt me.
The problem happen only when I do not login.
I guess at some point, wpDataTables try to check every table when it works, but the server only throw exception for when I do not login.
Please help me solve the problem. Thank you very much.
table_13 is not the ID of your table in back-end. That's the global JavaScript object called ‘wpDataTables‘, and it tells you this is the 7th table on your page. Every new table is assigned with an odd object number, so since you have (at least) 7 tables on the page, they will be:
I suppose this is a server-side table, because this error is usually there when an admin-ajax call that is sent receives a broken JSON response. This tends to happen when a security plugin or a security measure blocks the call for some reason.
Since the issue happens only for non-logged-in users, I suppose some security measure is blocking the admin-ajax call for everyone not logged into your website. You need to check your security plugins, and/or mod_security on your server, and reach out to your hosting provider about any other security measures imposed from the server.
Thank you very much for your reply. I disable every plug-in and the problem still remains. It seems that the maximum table in one page is 5. The tables from 6th will can't be loaded (it will be loaded if I move it up).
Yes, please provide me wp-admin user credentials, so I can take a look. Also tell me what's the table ID located on this page: https://vietnordic.com/doanh-nghiep/
Please make sure you have the Plugin Editor enabled, so I'm able to mess with wpDataTables' code.
This is a public ticket, so when you're posing your credentials, make sure to enable the PRIVATE response.
It seems that the errors come up only when I'm not logged into WordPress.
When I'm logged in, no matter how many times I refresh the page, the tables load normally, and there are no errors on the page.
So, this seems to be a security issue - maybe you have a security plugin blocking admin-ajax calls from wpDataTables, or it's set up on your server. If you can't figure out what's causing this, please reach out to your hosting provider, and ask them to investigate.
We have the infamous "Invalid JSON response" problem. One of the messages:
DataTables warning: table id=table_13 - Invalid JSON response. For more information about this error, please see http://datatables.net/tn/1
But the table_13 is no long existed. All similar messages show nonexistent tables. During the development I remove several tables, but they come back again to haunt me.
The problem happen only when I do not login.
I guess at some point, wpDataTables try to check every table when it works, but the server only throw exception for when I do not login.
Please help me solve the problem. Thank you very much.
Hello NGUYEN TRONG DUNG
Thank you for your purchase.
table_13 is not the ID of your table in back-end. That's the global JavaScript object called ‘wpDataTables‘, and it tells you this is the 7th table on your page. Every new table is assigned with an odd object number, so since you have (at least) 7 tables on the page, they will be:
table_1
table_3
table_5
table_7
table_9
table_11
table_13
I suppose this is a server-side table, because this error is usually there when an admin-ajax call that is sent receives a broken JSON response. This tends to happen when a security plugin or a security measure blocks the call for some reason.
Since the issue happens only for non-logged-in users, I suppose some security measure is blocking the admin-ajax call for everyone not logged into your website. You need to check your security plugins, and/or mod_security on your server, and reach out to your hosting provider about any other security measures imposed from the server.
Kind Regards,
Aleksandar Vuković
[email protected]
Rate my support
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia demo sites | Docs | Discord Community
You can try wpDataTables add-ons before purchasing on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables
Thank you very much for your reply. I disable every plug-in and the problem still remains. It seems that the maximum table in one page is 5. The tables from 6th will can't be loaded (it will be loaded if I move it up).
https://vietnordic.com/test-4/
A page with only one table also causes problem when I try a filter
https://vietnordic.com/doanh-nghiep/
Please try filter Ngành hàng: and you will see the problem.
I can give you an admin account to test the problem yourself.
Thank you very much.
Sol Nguyen
Hello again Sol Nguyen
Yes, please provide me wp-admin user credentials, so I can take a look. Also tell me what's the table ID located on this page: https://vietnordic.com/doanh-nghiep/
Please make sure you have the Plugin Editor enabled, so I'm able to mess with wpDataTables' code.
This is a public ticket, so when you're posing your credentials, make sure to enable the PRIVATE response.
Kind Regards,
Aleksandar Vuković
[email protected]
Rate my support
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia demo sites | Docs | Discord Community
You can try wpDataTables add-ons before purchasing on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables
Hi again Sol Nguyen
It seems that the errors come up only when I'm not logged into WordPress.
When I'm logged in, no matter how many times I refresh the page, the tables load normally, and there are no errors on the page.
So, this seems to be a security issue - maybe you have a security plugin blocking admin-ajax calls from wpDataTables, or it's set up on your server. If you can't figure out what's causing this, please reach out to your hosting provider, and ask them to investigate.
Kind Regards,
Aleksandar Vuković
[email protected]
Rate my support
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia demo sites | Docs | Discord Community
You can try wpDataTables add-ons before purchasing on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables