first commit

This commit is contained in:
编码猿
2024-09-27 02:06:13 +08:00
commit 852d94fbb9
36760 changed files with 3274413 additions and 0 deletions

View File

@@ -0,0 +1,54 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>ajax</title>
</head>
<body>
<ul>
</ul>
</body>
<!--<script>-->
<!-- function getData(res) {-->
<!-- console.log(res)-->
<!-- }-->
<!--</script>-->
<!--<script src="http://127.0.0.1:3000/api/json/info?call=getData"></script>-->
<script>
// 拿出电话
var ajax = new XMLHttpRequest();
// 输入号码
ajax.open("GET", "http://127.0.0.1:3000/api/json/index")
// 拨打电话
ajax.send()
// 对拨号的状态进行监听
ajax.onreadystatechange = function () {
if (ajax.readyState == 4) {
if (ajax.status == 200) {
var result = JSON.parse(ajax.responseText)
// var a = { name: 1 };
// console.log(JSON.parse(JSON.stringify(a)))
console.log(result.data)
result.data.newest.list.forEach(function (v){
document.querySelector("ul").innerHTML +=
`<li>
<img src="${v.preview}" alt="">
</li>`
})
} else {
console.log("请求错误")
}
}
}
</script>
</html>