下面是我想使用 jquery 的每个函数在 ajax-jquery 中处理的多维数值数组。我正在尝试使用 parseJSON 进行处理,但在警报结果中始终显示未定义。所以我没有编码这个数组以在 jquery 中处理。任何帮助都会得到帮助。提前致谢。
Array
(
[0] => Array
(
[image_mapid] => 22
[image_id] => 2
[user_id] => 1228143758
[pos_x] => 602.5333251953125
[pos_y] => 300.3333282470703
[image_width] => 100
[image_height] => 100
)
[1] => Array
(
[image_mapid] => 25
[image_id] => 2
[user_id] => 1326497290
[pos_x] => 446.5333251953125
[pos_y] => 250.3333282470703
[image_width] => 100
[image_height] => 100
)
[2] => Array
(
[image_mapid] => 26
[image_id] => 2
[user_id] => 1757521573
[pos_x] => 154
[pos_y] => 162
[image_width] => 204
[image_height] => 190
)
)
var tag_select = '<?php echo $basepath?>Userprofile/tagselect.php';
jQuery.ajax({
type: 'GET',
url: tag_select,
dataType:'json',
data: 'wallid='+wid+'&userid='+<?php echo $user_id;?>,
Success: function(data) {
$.each(data, function(idx, obj){
console.log(obj.image_mapid, obj.image_id)
})
}
});