Team:TU Delft/fbtest
From 2010.igem.org
(Difference between revisions)
(New page: <html> <div id="photobox"></div> <script> $(function() { //https://graph.facebook.com/112242102125963/albums var url = "https://graph.facebook.com/112242102125963/albums"; $.get(url, ...) |
|||
(2 intermediate revisions not shown) | |||
Line 1: | Line 1: | ||
<html> | <html> | ||
+ | <div id="fb_scriptload"></div> | ||
<div id="photobox"></div> | <div id="photobox"></div> | ||
- | <script> | + | <script type="text/javascript"> |
+ | |||
+ | var albumName = "</html>{{{album}}}<html>"; | ||
+ | |||
+ | 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() { | ||
- | + | var baseurl = "https://graph.facebook.com/112242102125963/"; | |
- | var url = " | + | 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"); | |
- | + | } | |
- | + | ||
- | + | fetchAlbums(); | |
}); | }); |
Latest revision as of 00:19, 16 June 2010