$ response = $ request-> execute();工作不正常

时间:2015-12-30 10:52:57

标签: php facebook

我正在尝试从facebook php sdk(v5.0.0)中获取用户的好友列表。目前我没有得到任何结果。在初步调试时,我得到的是执行代码直到echo' hi1'但代码没有在上面执行。我做了以下进口:

function calldata(value) {
    $('#goto').fadeOut('fast');

    jQuery.ajax({
        url: "data3.php",
        type: 'post',
        async: false, // why? Don't block your browser! Leave this out.
        data: {value: value}, // key/value, so PHP finds your data as "value"
        cache: false,
        dataType: "json",
        success: function(response) {

            var p = 10;
            var j = 0;
            var m; 

            var z = "<table >"; // moved here
            z = z + "<tr ><th></th><th>1</th><th>2</th><th>3</th><th>4</th><th>lunch</th><th>5</th><th>6</th><th>7</th><th>8</th></tr>";
            // Note: z needs one more column (10 in total!)
            var k = response.length;
            if (k > 10) // remove this IF, you need a value in ALL cases.
                m = k / 10;
            for (var o = 0; o < m; o++) {
                z = z + "<tr>";
                for (j; j < p; j++) {
                    var obj = response[j];
                    var go = obj.subject;
                    var no= obj.color;
                    z = z + "<td class='drop'></td>";
                }
                z = z + "</tr>";
                p = p + 10;
            }
            z = z + "</table>";
            document.getElementById("cool").innerHTML = z;

        }

    });
    goto1();
}

以下是我正在使用的代码。

use Facebook\GraphObject;
use Facebook\FacebookSession;
use Facebook\FacebookRedirectLoginHelper;
use Facebook\FacebookRequest;
use Facebook\FacebookResponse;
use Facebook\FacebookSDKException;

你能帮我解决一下这个问题。

1 个答案:

答案 0 :(得分:0)

请检查 Facebook \ FacebookRequest 执行() getGraphObject()这两项功能是否可用或您错过了某些内容或者您做了什么错误将数据传入 $request = new Facebook\FacebookRequest( $session, 'GET', '/me/friends' );

这样的课程