22 lines
No EOL
684 B
JavaScript
22 lines
No EOL
684 B
JavaScript
const grades_ = document.querySelector('#grades_');
|
|
|
|
myStorage = window.sessionStorage;
|
|
|
|
const getGrades = () => {
|
|
document.querySelector('#content').innerHTML = 'Here is grades (in my imagination)';
|
|
cookies_data = sessionStorage.getItem('cookies_data');
|
|
csrfcookie_ = sessionStorage.getItem('csrfcookie');
|
|
fetch(url = '../api/grades', {
|
|
method: 'POST',
|
|
mode: 'cors',
|
|
headers: {
|
|
'Content-Type': 'application/json',
|
|
'X-CSRFToken': csrfcookie_
|
|
},
|
|
body: cookies_data
|
|
}).then(response => response.json()).then(data => {
|
|
console.log(data);
|
|
})
|
|
}
|
|
|
|
grades_.addEventListener('click', getGrades); |