Answer the question
In order to leave comments, you need to log in
Why are var empty after audio.get method?
var urlSong = '';
var titleSong = '';
var artistSong = '';
var durationSong = '';
VK.api('audio.get', {count:1}, function(audio) {
//console.log(audio.response[0].url);
urlSong = audio.response[0].url,
titleSong = audio.response[0].title,
artistSong = audio.response[0].artist,
durationSong = audio.response[0].duration
})
var Playlist = [
{
mp3:urlSong,
title:titleSong,
artist:artistSong,
duration:durationSong
}
];
Answer the question
In order to leave comments, you need to log in
The question of asynchrony has already been raised 1000 times. Learn to use search.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question