$.ajax({
async: false,
type: "POST",
url: url+"module/listing/"+projectId,
data: "ajax=true",
success: function(response) {
$.each(response, function(key, val) {
alert(val.id);
});
}
});
Run Code Online (Sandbox Code Playgroud)
这是我的代码.Ajax成功我正在获得JSON响应.响应采用数组格式.我想提醒回应.但是获得"TypeError: invalid 'in' operand obj" JQuery 1.9.1版本的错误.
下面是我的ajax电话
$(document).ready(function() {
$("#blog").focusout(function() {
alert('Focus out event call');
alert('hello');
$.ajax({
url: '/homes',
method: 'POST',
data: 'blog=' + $('#blog').val(),
success: function(result) {
$.each(result, function(key, val) {
$("#result").append('<div><label>' + val.description + '</label></div>');
});
},
error: function() {
alert('failure.');
}
});
});
});
Run Code Online (Sandbox Code Playgroud)
我在控制台中的'operand obj'错误中遇到'TypeError:invalid'
提前谢谢你