当前位置:网站首页>Request object, send request
Request object, send request
2022-06-26 03:22:00 【Small vegetable bird yard live】
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
<ul id="list">
</ul>
<script>
//https://api.apiopen.top/musicRankings
//ajax
// 1. Create requested object
var xhr = new XMLHttpRequest();
var list = document.getElementById('list');
//2. Send a request
xhr.open('get','https://api.apiopen.top/musicRankings',true);
xhr.send();
//3. Listening state
xhr.onreadystatechange = function(){
if(xhr.readyState==4&&xhr.status==200){
var data = JSON.parse(xhr.responseText);
console.log(data);
for(var i=0;i<data.result.length;i++){
list.innerHTML += '<li>'+data.result[i].name+'<img src='+data.result[i].pic_s210+'></li>' ;
}
}
}
console.log(111);
</script>
</body>
</html>

边栏推荐
- Modifying table names, deleting tables, obtaining table information, and deleting table records on specified dates for common MySQL statements
- Please advise tonghuashun which securities firm to choose for opening an account? Is it safe to open an account online?
- MySQL开发环境
- 上传文件/文本/图片,盒子阴影
- Arduino string to hexadecimal number for large color serial port screen.
- stm32Cubemx:看门狗------独立看门狗和窗口看门狗
- [system architecture] - how to evaluate software architecture
- ArrayList#subList这四个坑,一不小心就中招
- Analysis on the diversification of maker space mechanism construction
- Is it safe to open an account in flush online? How to open a brokerage account online
猜你喜欢

Qt编译出错ERROR: Unknown module(s) in QT: script

Analysis and optimization of ue5 global illumination system lumen

云计算基础-0

丝网印刷的种类及其应用方法
![[solution] the blue screen restart problem of the virtual machine started by the VMware of Lenovo Savior](/img/c3/892ce2f45abea7140df98cabc1431b.png)
[solution] the blue screen restart problem of the virtual machine started by the VMware of Lenovo Savior

XGBoost, lightGBM, CatBoost——尝试站在巨人的肩膀上

How to prompt

【哈希表】改进,拉链法哈希结构——直接用两个索引查找,不用每次都hash和%一遍

UE5全局光照系統Lumen解析與優化

Classic quotations from "human nature you must not know"
随机推荐
UE5全局光照系統Lumen解析與優化
工业机器人之“慧眼”——机器视觉
todolist未完成,已完成
学习太极创客 — MQTT(五)发布、订阅和取消订阅
Do you want to add a key to the applet or for sequence?
I am in Zhongshan. Where can I open an account? Is it safe to open an account online?
Butterknife unbinder uses flashback in fragment and viewpager
学习太极创客 — MQTT(四)服务端连接操作
Network PXE starts winpe and supports UEFI and legacy boot
进度条
Arthas(阿尔萨斯) 能为你做什么?
Using meta analysis to drive the development of educational robot
Authorization of database
路由跳轉之點擊列錶的操作按鈕,跳轉至另一個菜單頁面並激活相應的菜單
P2483-[模板]k短路/[SDOI2010]魔法猪学院【主席树,堆】
MySQL开发环境
Is it safe to open an account in flush online? How to open a brokerage account online
Insect structure and Deconstruction
Hardware creation principle of campus maker space
MySQL增删查改(初阶)