Spaces:
Runtime error
Runtime error
{% extends 'base.html' %} | |
{% block content %} | |
<h1 id="topic">์ฃผ์ ๊ฐ ์ฌ๊ธฐ์ ํ์๋ฉ๋๋ค</h1> | |
<script> | |
// ์ฃผ์ ์ ๋ฐ์ดํธ ํจ์ | |
function updateTopic() { | |
fetch('/get_topic') | |
.then(response => response.json()) | |
.then(data => { | |
document.getElementById('topic').textContent = data.topic; | |
}) | |
.catch(error => console.error('Error fetching topic:', error)); | |
} | |
// ํ์ด์ง๊ฐ ๋ก๋๋ ๋ ์ฃผ์ ์ ๋ฐ์ดํธ | |
updateTopic(); | |
// 20์ด๋ง๋ค ์ฃผ์ ์ ๋ฐ์ดํธ | |
setInterval(updateTopic, 20000); | |
</script> | |
{% endblock %} | |