Skip to content

Commit

Permalink
Ig ottaa viikon taustan
Browse files Browse the repository at this point in the history
  • Loading branch information
ArttuKuikka committed Jul 26, 2023
1 parent 4378638 commit 0175e25
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion Views/IG/Index.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,25 @@
resizeText({
elements: document.querySelectorAll('.ruokatext'),
step: 0.5
})
});
fetch('/infotv/GetBgForWeek?week=@ViewBag.Viikko')
.then(response => {
if (!response.ok) {
throw new Error('Network response was not ok');
}
return response.json();
})
.then(data => {
console.log('Bg url = ' + data.fileName);
document.getElementById('bg').src = data.fileName;
})
.catch(error => {
console.error('There was a problem with the fetch operation:', error);
});
});
</script>
Expand Down

0 comments on commit 0175e25

Please sign in to comment.