I am starting a little jquery plugin for a youtube playlist and I am having problems constructing the URL properly
this is my code:
var playlist = {
playlist: '**',
apiKey: '**',
container: $('#test'),
shuffle: false
}
function player() {
var url = 'https://www.googleapis.com/youtube/v3/playlistItems?part=snippet&maxResults=50&playlistId=$'+playlist.playlist+'&key=$'+playlist.apiKey+'&callback=?';
console.log(url);
$.getJSON(url, function(result){
$.each(result, function(){
$('#test').append();
});
});
}
and this is what the url above returns:
{"error":{"errors":[{"domain":"global","reason":"invalidParameter","message":"Invalid value for parameter callback: ","locationType":"parameter","location":"callback"}],"code":400,"message":"Invalid value for parameter callback: "}}