当前位置:网站首页>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>

边栏推荐
- How to add a table to a drawing in ggplot2
- 在哪里开基金帐户安全?
- How Inkscape converts PNG pictures to SVG pictures without distortion
- [solution] cmake was unable to find a build program corresponding to "UNIX makefiles"
- kitti2bag 安装出现的各种错误
- 2021-08-04
- Google recommends using kotlin flow in MVVM architecture
- 路由跳转之点击列表的操作按钮,跳转至另一个菜单页面并激活相应的菜单
- 【QT】自定义控件-开关
- 解析少儿编程的多元评价体系
猜你喜欢

浅谈虚拟内存与项目开发中的OOM问题

Add console programs in UE

附加:HikariCP连接池简述;(并没有深究,只是对HikariCP连接池有个基本认识)

Clion项目中运行多个main函数

XGBoost, lightGBM, CatBoost——尝试站在巨人的肩膀上
![[hash table] improved, zipper hash structure - directly use two indexes to search, instead of hashing and% every time](/img/e3/1bedf03493283da327fef9ecc54542.jpg)
[hash table] improved, zipper hash structure - directly use two indexes to search, instead of hashing and% every time

Classic quotations from "human nature you must not know"
HL7Exception: Can‘t XML-encode a GenericMessage. Message must have a recognized struct

类图

校园创客空间的硬件造物原理
随机推荐
Butterknife unbinder uses flashback in fragment and viewpager
Record a torture bug caused by restcontrol and controller
【论文笔记】Deep Reinforcement Learning Control of Hand-Eye Coordination with a Software Retina
少儿编程对国内传统学科的推进作用
解析创客空间机制建设的多样化
Kotlin quick start
kotlin快速上手
Route jump: click the operation button of the list to jump to another menu page and activate the corresponding menu
经典模型——ResNet
【论文笔记】Learning to Grasp with Primitive Shaped Object Policies
Do you want to add a key to the applet or for sequence?
给网站添加“开放搜索描述“以适配浏览器的“站点搜索“
Is Guoxin golden sun reliable? Is it safe to open a securities account?
论文回顾:Unmixing-Based Soft Color Segmentation for Image Manipulation
用元分析法驱动教育机器人的发展
Utonmos: digital collections help the inheritance of Chinese culture and the development of digital technology
工作室第3次HarmonyOS培训笔记
Where is it safe to open a fund account?
网络PXE启动WinPE,支持UEFI和LEGACY引导
《你不可不知的人性》经典语录