I\'ve been stuck with this for several days and I can\'t solve it.
I\'ve done it with jQuery with no problem, but I need it in pure JS.
This is how my list is ge
Jsfiddle
Combination of james' answer and working example.
function get_friends(items) {
if (items != undefined) {
if (items.length != 0) {
var html_friends_list = "";
for (var count = 0; count < items.length; count++) {
if (items[count].subscription == "both") {
html_friends_list = html_friends_list + "- "+ items[count].display_name +"
";
}
}
html_friends_list = html_friends_list + '
'
document.getElementById("friends-list").innerHTML = html_friends_list;
}
}
}
Note: you should trigger prototype after your dom element created.