123456
color: grey;"><script type='text/javascript'>
$.get("https://v1.hitokoto.cn/",function(data,status){
if (status == 'success'){
$('.hitokoto').text(data.hitokoto+"By:"+data.from);
}else{
$('.hitokoto').text('获取出错!');
}
});
</script>
</div>
引用以上代码
或者以下方法
添加自定义JS,这个复制到Javascript里面保存
引用: 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
})
.catch(console.error)
然后在主页或者显示的地方落段
引用: <p id="hitokoto"><a href="#" id="hitokoto_text">:D 获取中...</a></p>
页:
[1]