im kinda new to php + javascript.
I have set up "cute file browser" to look at a shared folder on my computer. it works fine displays all files & folders no problem.
Now im trying to use OMDB to search for movie posters and then display them for each movie name.
currently it works but only with the first movie title. when inspecting the element in FF it does show all the other posters but only within the first
The following displays my Seperate movie folders - no problems works fine....
What I have tried:
if(scannedFolders.length) {
scannedFolders.forEach(function(f) {
var itemsLength = f.items.length,
name = escapeHTML(f.name);
if(itemsLength) {
icon = '
';
}
if(itemsLength == 1) {
itemsLength += ' item';
}
else if(itemsLength > 1) {
itemsLength += ' items';
getPoster(name);
}
else {
itemsLength = 'Empty';
}
var folder = $('
' + name + ' ');
folder.appendTo(fileList);
});
}
now i want to add movie posters using omdb...
function getPoster(finfo)
{
var filmName;
var realName;
filmName = finfo;
realName = filmName.split('.')[0];
var omdbUrl = "http://www.omdbapi.com/?t=" + realName;
$.ajax({
url: omdbUrl,
dataType: "text",
success: function(data) {
var json = $.parseJSON(data);
document.getElementById("folders").innerHTML += "<img id='imgposter' class='imgPoster' src='" + json.Poster + "'></img>";
}
});
}
but everything is displayed within the first folder rather than putting each image into its own LI....
https://i.stack.imgur.com/qHhdS.jpg
any help would be great thanks