Answer the question
In order to leave comments, you need to log in
How to pass values from one script to another?
There is a list of about 1000 audios, each has its own id, how can I pass this id to the field of the second script
function recommendate(){
VK.Api.call('audio.getRecommendations', {count: '1000'}, function(r) {
if(r.response) {
$('#playlist').empty().append($.map(r.response, function(song){
return '<li><a href="'+ song.url +'"><b>'+song.artist+'</b> - '+ song.title +'<span class="label">'+ song.aid +' - '+ song.owner_id+'</span></a><a href="javascript:addaudio();">+</a></li>'
}))
}
});
};
function addaudio(){
VK.Api.call('audio.add', { audio_id:' Как сюда воткнуть id песни? ', owner_id:'+ сюда id загр.пользователя+' }, function (data) {
if (data.response) {
console.log(data.response);
}
});
};
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question