Team:TU Delft/fb display
From 2010.igem.org
(Difference between revisions)
Line 8: | Line 8: | ||
function fb_photos(response) { | function fb_photos(response) { | ||
- | var n = | + | var n = 10; // select 6 random pictures |
var imghtml = ""; | var imghtml = ""; | ||
- | + | var done={}; | |
+ | var und; | ||
+ | var j=0; | ||
+ | while(j<n) ( | ||
var x = Math.round( Math.random()*response.data.length ); | var x = Math.round( Math.random()*response.data.length ); | ||
+ | if (und === done[x]) | ||
+ | continue; | ||
+ | done[x] = 1; | ||
+ | |||
var imgSmall = response.data[x].picture; | var imgSmall = response.data[x].picture; | ||
imghtml += '<img src=\"'+imgSmall+'">'; | imghtml += '<img src=\"'+imgSmall+'">'; | ||
+ | j++; | ||
} | } | ||
$("#photobox").html(imghtml); | $("#photobox").html(imghtml); |
Revision as of 00:43, 16 June 2010