Ajax, reported undefined error in thinkphp5, as shown in the figure

as shown in the picture, the undefinde error is reported, but I don"t understand the error. Please take a look at it.
clipboard.png

clipboard.png

clipboard.png

clipboard.png

Mar.20,2021

alert(data.errmsg); //  errmsg echo echo  return 

response check the results returned by the response to see what is returned


I think it is not the error of js, but the error of the result returned by the controller. If this is TP5, it should be the result of return so that the frontend can accept that


if (data.errno) is not data ['errno']


try to return the array directly. TP5 may be configured with JSON format by default.


tp5 returns json data directly to the ajax of js (['status'= > 1 json data returns = > $data]);
and then the js side is
success:function (e) {
if (e.status = = 1) {

    alert(e.data);
}                                   

}

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1ea4611-47aa6.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1ea4611-47aa6.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?