I have a dialog box implemented as HTML with a short script to call a server-side Apps Script function:
function ladeRezept() { const link = document.getElementById("link").value; console.log("Aufruf extrahiereVonChefkoch mit:", link); google.script.run.withSuccessHandler(function (data) { console.log("Daten vom Server empfangen:", data); document.getElementById("formular").style.display = "block"; document.getElementById("rezeptname").value = data.name; document.getElementById("aufwand").value = data.aufwand; document.getElementById("zutaten").value = data.zutaten.join(", "); document.getElementById("staples").value = data.staples.join(", "); document.getElementById("zubereitung").value = data.zubereitung; }).extrahiereVonChefkoch(link);}This seems to work because the web browser JavaScript console shows the expected messages from ladeRezept().
The problem is that the dialog box calls the server-side extrahiereVonChefkoch() function that also uses console.log(), but the web browser JavaScript console doesn't show those messages:
function extrahiereVonChefkoch(url) { console.log("Funktion extrahiereVonChefkoch wurde aufgerufen mit URL:", url); const html = UrlFetchApp.fetch(url).getContentText(); console.log("Length of fetched html: ", html.length); // ...}Why aren't the latter two messages shown in the web browser JavaScript console?