I would like to show random posts to my blogger.
I got a javascript from googling and tried it, but the number of random posts are not correct (should be 10 but some
So it seems that the feed entry at the randomized index is null, in that case add another condition to ensure that every entry in randomized indexes is not null.
Replace:
if(flag==0&&l!=0){
with:
if(flag==0&&l!=0&&json.feed.entry[l-1]!=null){
randarray[i++]=l;
}
I hope that solves your problem.
Regards,
PP
EDIT: Then you can call the feed url twice, this is the quick and dirty way to achieve so: