ASP : How to get the last index of FB friendlist Json.Parse 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
精彩评论