Код: Выделить всё
VK.api("audio.get", {}, function(data) { if (data.response) { var videoCount = data.response.length; var video_html = ''; for (var i=0; i<videoCount; i++) { video_html +='<h2>' + data.response[i].artist + ' - ' + data.response[i].title + '</h2>'; } $('#result').html(video_html); } else { $('#result').html('Ошибка!'); } }); });});
Код: Выделить всё
VK.api("audio.get", {count:1}, function(data) { if (data.response) { var videoCount = data.response.length; var video_html = ''; for (var i=0; i<videoCount; i++) { video_html +='<h2>' + data.response[i].artist + ' - ' + data.response[i].title + '</h2>' + '<iframe src="' + data.response[i].url + '"></iframe>'; } $('#result').html(video_html); } else { $('#result').html('Ошибка!'); } }); });});