Hi! Im using an embebed html in a layout. The idea is to change an image depending on the value of an API call.
When I put “fetch(URL);” inside the javascript, the display show nothing.
For example, only for testing purpuse, this code works:
<script>
function changeImage() {
const URL = "url";
tst = "https://dam.ngenespanol.com/wp-content/uploads/2019/03/luna-colores-nuevo.png" ;
document.getElementById("changer").src = tst;
}
</script>
but this one no:
<script>
function changeImage() {
const URL = "url";
fetch(URL);
tst = "https://dam.ngenespanol.com/wp-content/uploads/2019/03/luna-colores-nuevo.png" ;
document.getElementById("changer").src = tst;
}
</script>
And in the HTML:
<body onload=changeImage();>
<img src="" id="changer">
</body>
CMS Version: 2.3.2
Player Type: Windows player - v2 R201
Thanks!