title: How do I get album pictures using facebook API?
body: <p>This should be fairly common but somehow I cannot get it to work. What I would like to do is the get album pictures from facebook. I am implementing this on a website.</p>
  
  <p>I can get the albums using this code:</p>
  
  <pre><code>function getAlbumPhotos(){
              FB.api('/me/albums',  function(resp) {
                  //Log.info('Albums', resp);
                  var ul = document.getElementById('albums');
                  for (var i=0, l=resp.data.length; i&lt;l; i++){
                      var
                          album = resp.data[i],
                          li = document.createElement('li'),
                          a = document.createElement('a');
                      a.innerHTML = album.name;
                      a.href = album.link;
                      li.appendChild(a);
                      ul.appendChild(li);
                  }
              });
          };
  </code></pre>
  
  <p>the resp returns a data array which contains links to the photo albums BUT I would like the image sources for each album and I don't see anything I can use in the resp data. The data object contains a link to the album but not individual images. </p>
  
  <p>According to facebook documentation, photos are "connections" to albums. I am not sure what means but their doc shows that you can get individual photos.</p>
  
  <p>From this link:</p>
  
  <pre><code>[http://developers.facebook.com/docs/reference/api/album/][1]
  </code></pre>
  
  <p>it shows the json(?) returns link, id, name, etc...which I am able to get. However, at the bottom of that page are "connections" to album which includes photos, comments, pictures. When I click on photos, it shows the JSON data structure including the img src. Question is, how do I get that? It seems so straightforward but I can't get it to work.</p>
  
  <p>I tried </p>
  
  <pre><code>FB.api('/me/photos',function(resp) ...
  </code></pre>
  
  <p>and</p>
  
  <pre><code>FB.api('/me/photo',function(resp) ...
  </code></pre>
  
  <p>photos return nothing while photo returns undefine.</p>
  
  <p>Code samples will be greatly appreciated.</p>