Why when I use ajax data.SERVERPARTObject it displays undefined
世界只因有你2017-05-19 10:42:13
It is possible that the data format returned by the background is string type data, not a js object. Use JSON.parse to convert it into an object.
習慣沉默2017-05-19 10:42:13
You can print the type of data first
console.log(typeof data);
If it is a string, then JSON.parse(data);
世界只因有你2017-05-19 10:42:13
Did you miss a sentence in the ajax you wrote? dataType: 'json'
,跟上面的JSON.parse(data)
One meaning