32 lines
675 B
HTML
32 lines
675 B
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<title>Frasi</title>
|
|
<script>
|
|
function fetchData(){
|
|
fetch("/get_phrases")
|
|
.then(response => response.json())
|
|
.then(data =>{
|
|
let container = document.getElementById("content");
|
|
container.innerHTML = "";
|
|
data.forEach(line => {
|
|
let p = document.createElement("p");
|
|
p.textContent = line;
|
|
container.appendChild(p);
|
|
});
|
|
})
|
|
.catch(error => console.error("Error fetching data:", error));
|
|
}
|
|
|
|
setInterval(fetchData, 2000);
|
|
window.onload = fetchData;
|
|
</script>
|
|
</head>
|
|
<body>
|
|
<h1>Frasi</h1>
|
|
<div id="content"></div>
|
|
<br>
|
|
<a href="/input">Inserisci una frase</a>
|
|
</body>
|
|
</html>
|