From 0175e256f7baeb078e415f2df3c2d3934ba90541 Mon Sep 17 00:00:00 2001 From: Arttu Kuikka <75498768+ArttuKuikka@users.noreply.github.com> Date: Wed, 26 Jul 2023 19:56:06 +0300 Subject: [PATCH] Ig ottaa viikon taustan --- Views/IG/Index.cshtml | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/Views/IG/Index.cshtml b/Views/IG/Index.cshtml index 36cfb80..a0009b5 100644 --- a/Views/IG/Index.cshtml +++ b/Views/IG/Index.cshtml @@ -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); + }); + });