正在努力找出这个错误。我知道这与字符串不是 JSON 对象有关,但我无法修复它!
Uncaught TypeError: Cannot use 'in' operator to search for '25' in ["fgdf","dfergerg","Save"]
这是我的功能:
$(document).ready(function(){
$(".userIcon").click(function() {
var groupUsername = $(this).attr('id');
$.ajax({
type: "POST",
url: "groupUserList.php",
data:{"groupUsername" : groupUsername},
}).done(function(data) {
jQuery.each(data, function(name, value) {
if (value !== 'Save')
{
$(document).ready(function(){
console.log(value);
})
}
})
})
})
})
干杯
排序。只是缺少数据类型
dataType: "json",