title: Method callback not being hit
body: <p>I swear this was working last night which was why I was able to get to bed at 1am ;).  I come into work this morning and now it never gets to the callback of FB.api.  The FB.api is an async Facebook JS call...but regardless this was working fine last night and I don't think it's a facebook server (end point) issue.</p>
  
  <pre><code>            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;
                      }
  
                      var defaultAlbumID = aAlbums[0].id;
  
                      alert(" defaultAlbumID: " + defaultAlbumID);
  
                   });
              };
  
  
  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;
          }
  
          for (var i = 0, l = response.data.length; i &lt; l; i++) {
              alert("Album #: " + i + "\r\n" +
                    "response.data[i].id: " + response.data[i].id + "\r\n" +
                    "response.data[i].name: " + response.data[i].name + "\r\n" +
                    "response.data[i].count: " + response.data[i].count + "\r\n" +
                    "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);
          }
  
          alert("about to pass back the array to the callback function");
  
          callbackFunctionSuccess(aAlbums);
      });
  }
  </code></pre>
  
  <p>So it gets to the alert for the uri but never hits the first alert inside the FB.api callback..meaning it never hits alert("inside FB.api"); and I have no clue why.</p>
  
  <p><strong>UPDATED</strong></p>
  
  <p>Looks like all my api calls are being aborted.  Not sure what would abort it (the FB server?):</p>
  
  <p><a href="http://elbalazo.net/post/abortedcalls.jpg" rel="nofollow noreferrer">alt text http://elbalazo.net/post/abortedcalls.jpg</a></p>
  
  <p><strong>UPDATED #2</strong></p>
  
  <p>Ok looks like that abort is just saying the Http Request is done.  If I right-click that abort line in Firebug and select "Open in new tab" it's showing the HttpResponse data...but I think that's because it's sending a manual request when I do this just like you would copy and paste this request url into a browser manually...</p>
  
  <p>On the other hand if I right-click that abort line and choose "Copy Response Headers" I get nothing. Also when I check this out in Chrome, I see the Request Header but don't see any Response Header.  </p>
  
  <p>So still don't get then why it's not entering the callback then if I am getting back data from the FB.api call</p>
  
  <p><strong>UPDATED #3</strong></p>
  
  <p>Ok, got this working again.  I had the call to the callback method inside my FB.api's callback.  So it was bombing out.</p>
  
  <pre><code>function BindFacebookAlbumAndPhotoData()
  {
  GetAllFacebookAlbums(userID, accessToken, function(aAlbums) 
  {
  
      if (aAlbums === null || aAlbums === undefined) {
      alert("array is empty");
      return false;
      }
  
      // Set the default albumID
      var defaultAlbumID = aAlbums[0].id;
  
  };
  </code></pre>
  
  <p>function GetAllAlbums(userID, accessToken, callbackFunctionSuccess)
  {
      var aAlbums = []; // array
      var uri = "/" + userID + "/albums?access_token=" + accessToken;</p>
  
  <pre><code>//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;
      }
  
      for (var i = 0, l = response.data.length; i &lt; l; i++) {
          alert("Album #: " + i + "\r\n" +
                "response.data[i].id: " + response.data[i].id + "\r\n" +
                "response.data[i].name: " + response.data[i].name + "\r\n" +
                "response.data[i].count: " + response.data[i].count + "\r\n" +
                "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);
      }
  });
  
      alert("about to pass back the array to the callback function");
      callbackFunctionSuccess(aAlbums);
  </code></pre>
  
  <p>}</p>