当我试图从php shortcode函数获得多个响应时,其Json输出结果很奇怪。在我的php中,
$result[\'success\']=false;
$result[\'string\']=\'You have not uploaded project file, please upload first!\';
echo json_encode($result);
在js文件中$.post(ajax_object.ajax_url, { //POST request
...............
}, function(data) { //callback
console.log(data);
alert(data);
});
但在我的结果中,我得到了{"success":"true","string":"You have not uploaded project file, please upload first!"}0