当前位置:网站首页>app直播源码,点击搜索栏自动弹出下拉框
app直播源码,点击搜索栏自动弹出下拉框
2022-08-01 18:56:00 【云豹网络科技】
app直播源码,点击搜索栏自动弹出下拉框
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=
, initial-scale=1.0">
<title>Document</title>
</head>
<body>
搜索:<input type="text"><br>
<ul>
</ul>
</body>
</html>
<script>
let oInput=document.querySelector('input');
let oUl=document.querySelector('ul');
oInput.oninput=function (){
if(this.value != ""){
let xhr=new XMLHttpRequest();
xhr.open('GET','sousuo.php?wd='+this.value,true);
xhr.send();
xhr.onreadystatechange=function (){
if(xhr.readyState==4 && xhr.status==200){
fun(xhr.responseText);
console.log(xhr.responseText);
}
}
}else{
oUl.innerHTML = "";
}
}
function fun(resText){
//拼接
let strHtml='';
//将JSON形式的字符串转为数组
let obj=JSON.parse(resText);
for(let index in obj){
strHtml += `<li>${
obj[index]}</li>`;
}
oUl.innerHTML = strHtml;
}
</script>
以上就是 app直播源码,点击搜索栏自动弹出下拉框,更多内容欢迎关注之后的文章
边栏推荐
- Selenium在远程中的截图
- 【综述专栏】IJCAI 2022 | 图结构学习最新综述:研究进展与未来展望
- MLX90640 Infrared Thermal Imager Temperature Measurement Module Development Notes (Complete)
- Redis的内存淘汰策略和过期删除策略的区别是什么
- GZIPOutputStream 类源码分析
- LeetCode 0151.颠倒字符串中的单词
- 明尼苏达大学团队结合高通量实验与机器学习,实现有效可预测的特定位点重组过程,可调节基因编辑速度
- modbus总线模块DAM-8082
- Heavy cover special | build the first line of defense, cloud firewall offensive and defensive drills best practices
- #yyds dry goods inventory# Interview must brush TOP101: the last k nodes in the linked list
猜你喜欢
How many steps does it take to convert an ENS domain name into music?
明尼苏达大学团队结合高通量实验与机器学习,实现有效可预测的特定位点重组过程,可调节基因编辑速度
Prometheus的Recording rules实践
log factory (detail)
文库网站建设源码分享
The life cycle and scope
7月30号|来一场手把手助您打造智能视觉新爆款的技术动手实验
网站建设流程
Multi-Party Threshold Private Set Intersection with Sublinear Communication-2021:解读
[Neural Network] This article will take you to easily analyze the neural network (with an example of spoofing your girlfriend)
随机推荐
MLX90640 Infrared Thermal Imager Temperature Measurement Module Development Notes (Complete)
Tencent Cloud Hosting Security x Lightweight Application Server | Powerful Joint Hosting Security Pratt & Whitney Version Released
在GBase 8c数据库后台,使用什么样的命令来对gtm、dn节点进行主备切换的操作?
Library website construction source code sharing
AntDB数据库亮相24届高速展,助力智慧高速创新应用
COS User Practice Call for Papers
The elder brother of the goldfish RHCA memoirs: CL210 experiment management it network - chapter
Stop using MySQL online DDL
安徽建筑大学&杭州电子科技大学|基于机器学习方法的建筑可再生能源优化控制
odoo+物联网
力扣刷题之移动零
explain 各字段介绍
随时随地写代码--基于Code-server部署自己的云开发环境
C#/VB.NET: extracted from the PDF document all form
Become a Contributor in 30 minutes | How to participate in OpenHarmony's open source contributions in multiple ways?
How many steps does it take to convert an ENS domain name into music?
【pyqt5】自定义控件 实现能够保持长宽比地缩放子控件
#yyds dry goods inventory# Interview must brush TOP101: the last k nodes in the linked list
重保特辑|筑牢第一道防线,云防火墙攻防演练最佳实践
Hardware Bear Original Collection (Updated 2022/07)