Team:TU Delft/fbtest

From 2010.igem.org

(Difference between revisions)
 
(One intermediate revision not shown)
Line 5: Line 5:
<script type="text/javascript">
<script type="text/javascript">
-
function fb_albums(data) {
+
var albumName = "</html>{{{album}}}<html>";
-
alert("fb_albums");
+
function fb_albums(response) {
-
    
+
  for(var i in response.data) {
 +
    var item = response.data[i];
 +
    $("#photobox").append(item.name + "<br>");
 +
   }
 +
 
 +
  var n = 6; // select 6 random pictures
 +
  for(var i=0;i<n;i++) {
 +
   
 +
  }
}
}
$(function() {
$(function() {
-
//https://graph.facebook.com/112242102125963/albums
+
var baseurl = "https://graph.facebook.com/112242102125963/";
 +
 
 +
function addScript(url) {
 +
  var html = '<script src="'+ url + '" type="text/javascript"></scr'+'ipt>';
 +
  $("#fb_scriptload").html(html);
 +
}
 +
 
 +
function fetchAlbums() {
 +
  addScript(baseurl + "albums?callback=fb_albums");
 +
}
-
var url = "https://graph.facebook.com/112242102125963/albums?callback=fb_albums";
+
fetchAlbums();
-
$("#fb_scriptload").html(
+
-
  "<script src=\"" + url + "\" type=\"text/javascript\"></script>\"");
+
});
});

Latest revision as of 00:19, 16 June 2010