You're appending the titles to an array (filmnamevar
) but then you're accessing filmnamevar
directly as if it were a string.
You'll need to loop the array, calling a new getJSON request for each title (unless the movie db API let's you pull many at once):
for( var i = 0; i < filmnamevar.length; i++){
$.getJSON('http://api.themoviedb.org/3/search/movie?query='+filmnamevar[i]+'&api_key=81c50c197b83129dd4fc387ca6c8c323&limit=1',function(data2){
$(data2.results,function(i,rat){
$('#epis').append('<div class="rating">'+rat.vote_average+'</div>');
});
});
}