Facebook Javascript SDK - 查询配置文件图片 [英] Facebook Javascript SDK - Query Profile Picture

查看:134
本文介绍了Facebook Javascript SDK - 查询配置文件图片的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试通过JavaScript SDK查询个人资料图片。

I'm trying to query the Profile picture via the Javascript SDK.

我不希望图形api链接,我想得到 src_big 链接。

I do not want the graph api link, I want to get the src_big link.

我有以下代码:

FB.api("/me", {fields: "id,name,picture"}, function(response)
{

    alert( response.picture );


    FB.api(
            {
                method: 'fql.query',
                query: 'SELECT pid, src_big, src_big_height, src_big_width FROM photo WHERE aid IN ( SELECT aid FROM album WHERE owner="' + response.id + '" AND name = "Profile Pictures")'
            },
            function(data1) {

                alert('BIG ' + data1.pic_big );

            }
    );


});

它应该给我 src_big 但它没有。

有没有人有这个成功?

It should give me the src_big but it does not.
Has anyone had any success with this?

推荐答案

问题不在查询它,问题是访问对象时。

The problem was not while querying it, the problem was while accessing the object.

它必须以奇怪的方式访问。

It has to be accessed in a weird way.

FB.api("/me", {fields: "id,name,picture"}, function(response)
{

    FB.api(
            {
                method: 'fql.query',
                query: 'SELECT pid, src_big, src_big_height, src_big_width FROM photo WHERE aid IN ( SELECT aid FROM album WHERE owner="' + response.id + '" AND name = "Profile Pictures")'
            },
            function(data1) {
                alert( data1[0].src_big );
            }
    );

});

谢谢

这篇关于Facebook Javascript SDK - 查询配置文件图片的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆