Como adicionar o header nesta solicitação jSON?
Olá pessoal,
alguém sabe como eu adiciono o header no script abaixo?
*headers:{
'Authorization' : 'Bearer '+accessToken,
'Content-Type' : 'application/json'
}*
------------------------------------- SCRIPT PARA ADICIONAR O HEADER -----------------------------------
jQuery.get('data.json', function (data) {
var videosConfig = {
list: tvApp.videoList,
data: JSON.parse(data),
callback: function () {
var movies = document.querySelectorAll('.navigable');
var i=0;
for (i = 0; i < movies.length; i += 1) {
movie = movies*;*
*
movie.removeEventListener('focus', onFocus);*
*
movie.addEventListener('focus', onFocus);*
*
}
*
*
**
*
*
function documentOffsetTop(el) {*
*
return el.offsetTop + ( el.offsetParent ? documentOffsetTop(el.offsetParent) : 0 );*
*
}
*
*
**
function onFocus(e) {*
*
console.log(e);*
*
var el = document.querySelector('.navigable.focused');*
*
var top = documentOffsetTop(el) - ( window.innerHeight / 3 );*
*
app.videoList.parentNode.scrollTop = top;*
*
app.stateObj.videoId = el.dataset.videoid;*
*
app.stateObj.videoURL = el.dataset.video;*
*
}*
*
}*
*
};*
*
new VideoList(videosConfig);*
*
bishopNavigation.focus(document.getElementById('video-list').firstElementChild, 'keyboard');*
*
*
*
*
*
});
*
*
**
*
Discussão (1)
Carregando comentários...