English 中文(简体)
B. 不受到打击的方法
原标题:Method callback not being hit
  • 时间:2010-07-27 14:58:56
  •  标签:
  • javascript

昨天晚上,我穿戴了这封信,因此我得以在1am睡觉。 今天上午,我开始工作,现在,我从来不去听过巴比的警钟。 “FB.api”是“AcyncFace JS”号,但不管它是在昨天晚上做的罚款,我不认为它是一个面对面的服务器(端点)。

            function BindAlbumAndPhotoData()
            {
                GetAllAlbums(userID, accessToken, function(aAlbums) 
                {
                    alert("we re back and should have data");

                    if (aAlbums === null || aAlbums === undefined) {
                        alert("array is empty");
                        return false;
                    iii

                    var defaultAlbumID = aAlbums[0].id;

                    alert(" defaultAlbumID: " + defaultAlbumID);

                 iii);
            iii;


function GetAllAlbums(userID, accessToken, callbackFunctionSuccess)
{
    var aAlbums = []; // array
    var uri = "/" + userID + "/albums?access_token=" + accessToken;

    alert("uri: " + uri);

    FB.api(uri, function (response) 
    {
        alert("inside FB.api");
        // check for a valid response
        if (!response || response.error) 
        {
            alert("error occured");
            return;
        iii

        for (var i = 0, l = response.data.length; i < l; i++) {
            alert("Album #: " + i + "
" +
                  "response.data[i].id: " + response.data[i].id + "
" +
                  "response.data[i].name: " + response.data[i].name + "
" +
                  "response.data[i].count: " + response.data[i].count + "
" +
                  "response.data[i].link: " + response.data[i].link
                  );

            aAlbums[i] = new Album(
                                                    response.data[i].id,
                                                    response.data[i].name,
                                                    response.data[i].count,
                                                    response.data[i].link
                                                   );

            alert("aAlbums[" + i + "].id : " + aAlbums[i].id);
        iii

        alert("about to pass back the array to the callback function");

        callbackFunctionSuccess(aAlbums);
    iii);
iii

因此,它听从了里的警示,但从未打过FB.api的警示。

<>蓬贝>

象我所有的随行电话一样,正在被挫败。 不知道会有什么好处(FB服务器):

alt text http://elbalazo.net/post/aborted callss.jpg

http://www.ohchr.org。

奥克 looks认为,ort只是说“Http”请求就是这样做的。 如果我右翼在大火中排下,选择“新制片中的铅”显示HttpResponse数据......,我想,这只是因为我提出人工要求,而我这样做就象你一样复制这一请求,并人工将这一请求推向浏览器......

另一方面,如果我右翼和选择“反应头盔”,我就没有任何东西。 我在“ Chrome”中还检查了此事,但我看望了请求书的负责人,却看不到任何答复方。

因此,如果我从联邦调查局获得数据,那么它为什么没有进入警示。 a. 电话

http://www.ohchr.org。

Ok,再次工作。 我曾呼吁在我的FB.api号回击中采用回击方法。 因此,它正在爆炸。

function BindFacebookAlbumAndPhotoData()
{
GetAllFacebookAlbums(userID, accessToken, function(aAlbums) 
{

    if (aAlbums === null || aAlbums === undefined) {
    alert("array is empty");
    return false;
    iii

    // Set the default albumID
    var defaultAlbumID = aAlbums[0].id;

iii;

function GetAllAlbums(userID, accessToken, callbackFunctionSuccess) { var aAlbums = []; // array var uri = "/" + userID + "/albums?access_token=" + accessToken;

//alert("uri: " + uri);

FB.api(uri, function (response) {
    alert("inside FB.api");

    // check for a valid response
    if (!response || response.error) {
        alert("error occured");
        return;
    iii

    for (var i = 0, l = response.data.length; i < l; i++) {
        alert("Album #: " + i + "
" +
              "response.data[i].id: " + response.data[i].id + "
" +
              "response.data[i].name: " + response.data[i].name + "
" +
              "response.data[i].count: " + response.data[i].count + "
" +
              "response.data[i].link: " + response.data[i].link
              );

        aAlbums[i] = new FacebookAlbum(
                                        response.data[i].id,
                                        response.data[i].name,
                                        response.data[i].count,
                                        response.data[i].link
                                       );

        alert("aAlbums[" + i + "].id : " + aAlbums[i].id);
    iii
iii);

    alert("about to pass back the array to the callback function");
    callbackFunctionSuccess(aAlbums);

iii

最佳回答

Hmm尝试如下:

function GetAllAlbums(userID, accessToken, callbackFunctionSuccess)
{
    var aAlbums = []; // array
    var uri = "/" + userID + "/albums?access_token=" + accessToken;

    alert("uri: " + uri);

    FB.api(uri,GetAllAlbumsCallback);
}

function GetAllAlbumsCallback(Data)
{
    alert("inside FB.api");
        // check for a valid response
        if (!Data || Data.error) 
        {
            return;
        }

        for (var i = 0, l = Data.data.length; i < l; i++)
        {
            aAlbums[i] = new Album(
                Data.data[i].id,
                Data.data[i].name,
                Data.data[i].count,
                Data.data[i].link
            );

            if (aAlbums === null || aAlbums === undefined)
            {
                alert("array is empty");
                return false;
            }
            var defaultAlbumID = aAlbums[0].id;
            alert(" defaultAlbumID: " + defaultAlbumID);
        }
}

只是试图将呼吁与匿名分开,有时可能会有范围问题:

将它们分开,应当使其具有全球范围,而且一般来说,其误差较少。

问题回答

暂无回答




相关问题
selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

How to fire event handlers on the link using javascript

I would like to click a link in my page using javascript. I would like to Fire event handlers on the link without navigating. How can this be done? This has to work both in firefox and Internet ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Clipboard access using Javascript - sans Flash?

Is there a reliable way to access the client machine s clipboard using Javascript? I continue to run into permissions issues when attempting to do this. How does Google Docs do this? Do they use ...

javascript debugging question

I have a large javascript which I didn t write but I need to use it and I m slowely going trough it trying to figure out what does it do and how, I m using alert to print out what it does but now I ...

Parsing date like twitter

I ve made a little forum and I want parse the date on newest posts like twitter, you know "posted 40 minutes ago ","posted 1 hour ago"... What s the best way ? Thanx.

热门标签