0
I have the following function:
function album(music){
var album;
request('http://localhost/socket/source.php?music='+music+'', function (error, response, result){
data = JSON.parse(result);
album = data['return'];
});
return album;
}
I would like to call this function return the album value.
I’m trying to call it that:
io.emit('updateNext', {
'nextArtist': result['Playlist']['Next'][0]['NextMusic'][0]['Music'][0]['Artist'],
'nextMusic': result['Playlist']['Next'][0]['NextMusic'][0]['Music'][0]['Title'],
'nextAlbum': album('eae')
});
But it’s returning undefined. How can I resolve this?
Thank you very much friend. It helped me a lot!
– Paulo Sérgio Filho
@Paulosérgiofilho if the answer solved your problem don’t forget to accept it as correct by clicking the accept button next to the answer
– Sorack
I am only waiting for the time necessary to accept. It cannot be immediately s:
– Paulo Sérgio Filho