JSON Parse Error: unexpected end of data at line 1 column 1 of the JSON data

后端 未结 2 810
借酒劲吻你
借酒劲吻你 2021-01-20 13:48

I have a database, analysis.php and index.php webpages. The analysis.php gets the data from the database, sorts it in a required pattern, and then echoes the json_enco

2条回答
  •  感动是毒
    2021-01-20 14:17

    In addition to LJ_1102's solution, here is a way to fix your current snippet:

    JSONText.load('analysis.php?data=' + identification + ' #data', function() {
    
        console.log("JSON Imported: '" + identification + "'");
        var obj = jQuery.parseJSON(JSONText.text());
        console.log(JSONText.text());
    
    });
    

提交回复
热议问题