需要咨询JS绝地。情况:我得到了带有 USER_ID 的数组,需要调用社交网络功能才能在他们的墙上发帖。所以我需要启动 wallpost 功能,听听它的答案,然后继续迭代我的循环。我编写的代码能够将帖子留给数组中的最后一个人,到第一个,到没有以及许多其他有用的功能:s。需要你的帮助
function showPost() {
for(i in selFriends) { //selFriends - massive with user_id
alert(i+' '+selFriends[i]); //checkplace
VK.api('wall.post',{
owner_id:selFriends[i], //element
message:htmlres, // content
attachment:photoID // id of the mediacontent
},function(receive) {
showPost();
});
return;
}
}
这段代码需要修复,因为现在它只是大量的第一个元素的迭代墙。顺便说一句,方法 VK.api 几乎类似于 Facebook UI 方法“提要”。非常感谢你 :)