Bug 1:
1. The data in this is just a one-dimensional array
{"state": 0, "ErrorCode": 0, "data": {"Originalname": "", "Name": "3e12cdbd9d855449440035b3fdaf78bd.png", "url"
: "Images\/release\/3\/d\/3e12cdbd9d855449440035b3fdaf78bd.png", "Real_url": "Http:\/\/cache.hinabian.com
\/images\/release\/3\/d\/3e12cdbd9d855449440035b3fdaf78bd.png "," size ": 94064," type ":". png "," state ":" SUCCESS "
}}
2. The data in this is a two-dimensional array, is not good to hear is the background is the two-dimensional array is encoded in JSON format, the return of the
{"state": 0, "ErrorCode": 0, "data": [{"f_id": "1", "F_brand": "Dada", "F_name": "\u4ef7\u503c110\u5143\u7684\u55d2\ u55d2\u5df4\u58eb\u4ee3\u91d1\u5238\u5957\u7968\u4e00\u5957 "," F_no ":" $ "," f_img ":" Dd110.png "," F_qrcode ":" Ddqr.png "}]}
Bug 2:
1. Note The data format returned by Ajax after the PHP request, and the value obtained through Array.indexof () is surprising.
var arr_real = [' 2 ', ' 3 ', ' 4 ', ' 11 ']; A string array of JavaScript
var id = json_msg.data.f_id;
Console.log (Arr_real.indexof (ID)!==-1); True/false
2. Note the data format returned by Ajax after the PHP request, and the value obtained through Array.indexof () is surprising.
var arr_real = [2, 3, 4, 11]; A numeric array of javascript
var id = json_msg.data.f_id;
Console.log (Arr_real.indexof (ID)!==-1); False
[Javascript-debug-ajax-json] Two different JSON format data