这里将会显示一句话

源代码

1
2
3
4
5
6
7
8
9
10
<script>
fetch('https://v1.hitokoto.cn')
.then(response => response.json())
.then(data => {
const hitokoto = document.getElementById('hitokoto_text')
hitokoto.href = 'https://hitokoto.cn/?uuid=' + data.uuid
hitokoto.innerText = data.hitokoto + " ——" + data.from
})
.catch(console.error)
</script>