【发布时间】:2017-08-25 14:29:55
【问题描述】:
我有一个这样的数组
数组
(
[0] => 131
[1] => 103
[2] => 21
[3] => 94
[4] => 107
[5] => 130
[6] => 92
[7] => 128
[8] => 115
[9] => 81
)
如何在ajax调用中传递这个数组
Javascript 代码是:
$(document).ready(function(){
var recentchatfriendids = [];
//actual array
$.ajax({
url: '/friends/message/getmessagestatus';
data: {
recentchatfriendids : recentchatfriendids
},
success: function(response){
},
});
});
【问题讨论】:
-
你试过什么???
-
显示完整的 javascript 代码
-
echo json_encode(yourArrayVariableGoesHere) -
@MayaShah 肯定是重复的