Occasional Ajax error

Occasional Ajax error

mohammedkadhimmohammedkadhim Posts: 1Questions: 1Answers: 0

Hello,
Been using DataTables since more than 2 years it always work flawlessly. But starting last week, I noticed a very strange issue whenever I try to view a table I get an error message "DataTables warning: table id=table_1 - Ajax error. For more information about this error, please see http://datatables.net/tn/7"

The message appear while the page is being rendered. A loading icon appears and then nothing happens. The loading icon will keep looping.
What makes this issue so strange is that sometimes the page load successfully but most of the time it doesn't. I'd say 1 out of 20 chances it'll work.

I've tried everything. I did what is being said on this page (Ajax Error) but sadly no luck.

I feel like maybe something is timing out before the page is fully loaded. Maybe I'm wrong but why would the table load sometimes and other times it doesn't? Strange.

This is the link to that page: Click Here
Here is another table on my website which has the same error: Click Here

Any idea?

Answers

  • kthorngrenkthorngren Posts: 20,298Questions: 26Answers: 4,769

    The response I get for the first table is the Ajax error. Looking at the Developer Tools the response is 404 not found:

    Request URL: http://uokufa.edu.iq/wp-admin/admin-ajax.php?action=get_wdtable&table_id=7
    Request Method: POST
    Status Code: 404 Not Found
    Remote Address: 104.27.172.197:80
    Referrer Policy: no-referrer-when-downgrade
    

    This is an error from the server. You will need to debug the server logs to find out why the page is not found. Or there is another error in the server causing the 404 not found.

    The other page has this error:

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

    Looking at the response in the browser's Developer Tools the response looks to be incomplete. Copied the response text into https://jsonlint.com/ it shows the end of the response is missing:

    {
        "draw": 1,
        "recordsTotal": "1000",
        "recordsFiltered": "1000",
        "data": [
                ["1", "3.001", "\u0646\u0638\u0627\u0645 \u0625\u0633\u062a\u0631\u062c\u0627\u0639 \u0627\u0644\u0635\u0648\u0631 \u0628\u0644\u0625\u0639\u062a\u0645\u0627\u062f \u0639\u0644\u0649 \u0627\u0644\u0645\u062d\u062a\u0648\u064a\u0627\u062a \u0648\u0628\u0625\u0633\u062a\u0639\u0645\u0627\u0644 \u0627\u0644\u0642\u0648\u0627\u0639\u062f \u0627\u0644\u0645\u0636\u0628\u0628\u0629 ", "\u0645\u0627\u062c\u0633\u062a\u064a\u0631", "\u062d\u0633\u0646\u0627\u0621 \u0639\u0645\u0627\u062f \u0639\u0628\u062f \u0627\u0644\u0633\u0644\u0627\u0645", "\u0627\u0644\u0646\u0647\u0631\u064a\u0646", "\u062d\u0627\u0633\u0628\u0627\u062a", "\u0644\u0624\u064a \u0623\u062f\u0648\u0631 \u062c\u0648\u0631\u062c", "<a href='http:\/\/uokufa.edu.iq\/wp-content\/uploads\/Thesis_dir\/3001.pdf' target='_self'><button class=''>\u062a\u062d\u0645\u064a\u0644<\/button><\/a>"],
                ["2", "3.002", "\u062f\u0631\u0627\u0633\u0629 \u0627\u0644\u062e\u0648\u0627\u0635 \u0627\u0644\u062a\u0631\u0643\u064a\u0628\u064a\u0629 \u0648\u0627\u0644\u0628\u0635\u0631\u064a\u0629(PbS)\u0644\u063a\u0634\u0627\u0621 (ZnS)\u0648\u0644\u063a\u0634\u0627\u0621", "\u0645\u0627\u062c\u0633\u062a\u064a\u0631", "\u0635\u0627\u0628\u0631 \u062c\u0627\u0633\u0645 \u0645\u062d\u0645\u062f", "\u062a\u0643\u0631\u064a\u062a", "\u0627\u0644\u0641\u064a\u0632\u064a\u0627\u0621", "\u0635\u0628\u0631\u064a \u062c\u0627\u0633\u0645 \u0645\u062d\u0645\u062f", "<a href='http:\/\/uokufa.edu.iq\/wp-content\/uploads\/Thesis_dir\/3002.pdf' target='_self'><button class=''>\u062a\u062d\u0645\u064a\u0644<\/button><\/a>"],
    <cut rows 3 - 23>
                ["24", "3.024", "\u062a\u0623\u062b\u064a\u0631 \u0627\u0644\u0645\u0646\u0627\u062e \u0627\u0644\u062a\u0646\u0638\u064a\u0645\u064a \u0641\u064a \u0627\u0644\u062a\u0643\u064a\u0641 \u0627\u0644\u0628\u064a\u0626\u064a \u0644\u062f\u0649 \u0623\u0646\u062f\u064a\u0629 \u0627\u0644\u0645\u0646\u0637\u0642\u0629 \u0627\u0644\u0634\u0645\u0627\u0644\u064a\u0629 \u0645\u0646 \u0627\u0644\u0639\u0631\u0627\u0642", "\u062f\u0643\u062a\u0648\u0631\u0627\u0647", "\u0645\u062d\u0645\u062f \u0630\u0627\u0643\u0631 \u0633\u0627\u0644\u0645 \u0639\u0628\u062f \u0627\u0644\u0644\u0647 \u0646\u062c\u064a\u0628", "\u0627\u0644\u0645\u0648\u0635\u0644", "\u0627\u0644\u0625\u062f\u0627\u0631\u0629 \u0648\u0627\u0644\u062a\u0646\u0638\u064a\u0645", "\u0631\u0627\u0634\u062f \u062d\u0645\u062f\u0648\u0646 \u0630\u0646\u0648\u0646", "<a href='http:\/\/uokufa.edu.iq\/wp-content\/uploads\/Thesis_dir\/3024.pdf' target='_self'><button class=''>\u062a\u062d\u0645\u064a\u0644<\/button><\/a>"],
                ["25", "3.025", "\u062f\u0631\u0627\u0633\u0629 \u0644\u0641\u0639\u0627\u0644\u064a\u0629 \u0648\u062e\u0648\u0627\u0635 \u0627\u0646\u0632\u064a\u0645 \u0627\u0644\u0627\u062f\u064a\u0646\u0648\u0633\u064a\u0646 \u062f\u064a \u0627\u0645\u064a\u0646\u064a\u0632 \u0641\u064a \u062e\u0645\u064a\u0631\u0629 Candida albicans \u0648\u0645\u0642\u0627\u0631\u0646\u062a\u0647 \u0628\u0628\u0639\u0636 \u0627\u0644\u062e\u0644\u0627\u064a\u0627 \u062d\u0642\u064a\u0642\u064a\u0629 \u0627\u0644\u0646\u0648\u0627\u0629", "\u0645\u0627\u062c\u0633\u062a\u064a\u0631", "\u0627\u0646\u0639\u0627\u0645 \u0627\u062d\u0645\u062f \u062d\u0645\u0632\u0629 \u062d\u0633\u064a\u0646 \u0627\u0644\u062f\u0627\u063a\u0633\u062a\u0627\u0646\u064a", "\u0627\u0644\u0645\u0648\u0635\u0644", "\u0639\u0644\u0648\u0645 \u0627\u0644\u062d\u064a\u0627\u0629 ", "\u0642\u0635\u064a \u0639\u0628\u062f \u0627\u0644\u0642\u0627\u062f\u0631 \u0645\u0635\u0637\u0641\u0649 \u0627\u0644\u062c\u0644\u0628\u064a", "<a href='http:\/\/uokufa.edu.iq\/wp-content\/uploads\/Thesis_dir\/3025.pdf' target='_self'><button class=''>\u062a\u062d\u0645\u064a\u0644<\/button><\/a>
    

    It abruptly ends without closing the arrays. Not sure why. You will need to start at the server to determine why the full JSON is not in the response.

    Kevin

This discussion has been closed.