开发者

ASP : How to get the last index of FB friendlist Json.Parse data?

开发者 https://www.devze.com 2023-04-07 01:41 出处:网络
I 开发者_运维百科use json2.asp in my app. This is the code to parse friend list json data. Set friendlist = JSON.parse(friendlist_json_data)

I 开发者_运维百科use json2.asp in my app. This is the code to parse friend list json data.

Set friendlist = JSON.parse(friendlist_json_data)

The result, I can get first friend id with this code

friendid = friendlist.data.get(0).id

So the friendid = 1234567890 (something like that)

The question is, how to get the last index of friendlist array?

I try to use

lastindex = friendlist.data.get.count

and

lastindex = ubound(friendlist.data.id)

but nothing work.

I hope someone will help me because I want to show all user's friends photo profile in my app.


You need length of the object called data.
Like this:

lastindex = friendlist.data.length - 1
friendid = friendlist.data.get(lastIndex).id
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号