ブラウザで AJAX リクエストが機能しています。ここで、TVML プロジェクトの JSON データに対して GET 要求を使用する必要があります。どのように行うのが良いですか?
私は XMLHttpRequest を試していましたが、うまくいきませんか、何か間違ったことをしたのでしょうか?
function performRequest(type, route, data) {
return $.ajax({
type: type,
dataType: 'json',
url: url + route,
data: data
});
}
function getChannels() {
log(' > get channels');
return performRequest('GET', 'channel/list', {
id: browserId
}).then(function (response) {
response.data.forEach(function (channel) {
channels[channel.id] = channel;
});
});
}