当前位置:网站首页>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直播源码,点击搜索栏自动弹出下拉框,更多内容欢迎关注之后的文章
边栏推荐
- How to record and analyze your alchemy process - use notes of the visual artifact Wandb [1]
- How to build a CMDB driven by consumption scenarios?
- Selenium在远程中的截图
- Stop using MySQL online DDL
- 123123123123
- 123123123123
- Break the performance ceiling!AsiaInfo database supports more than 1 billion users, with a peak of one million transactions per second
- C#/VB.NET 从PDF中提取表格
- C#/VB.NET:从 PDF 文档中提取所有表格
- modbus bus module DAM-8082
猜你喜欢
基于flowable的upp(统一流程平台)运行性能优化
Win11校园网无法连接怎么办?Win11连接不到校园网的解决方法
亚马逊云科技Build On2022技能提升计划第二季——揭秘出海爆款新物种背后的黑科技
无需破解,官网安装Visual Studio 2013社区版
C#/VB.NET:从 PDF 文档中提取所有表格
Win11怎么安装语音包?Win11语音包安装教程
在全志V853开发板试编译QT测试
MLX90640 Infrared Thermal Imager Temperature Measurement Module Development Notes (Complete)
kubernetes - deploy nfs storage class
Keras深度学习实战——交通标志识别
随机推荐
硬件大熊原创合集(2022/07更新)
LeetCode 0152. Product Maximum Subarray: dp + Roll in Place
通配符 SSL/TLS 证书
Leetcode74. Search 2D Matrix
How opencv implements image skew correction
Heavy cover special | build the first line of defense, cloud firewall offensive and defensive drills best practices
钳形万用表使用方法,如何测量电压、电流、电阻?
网站建设流程
【LeetCode】Day109-最长回文串
屏:全贴合工艺之GFF、OGS、Oncell、Incell
亚马逊云科技Build On2022技能提升计划第二季——揭秘出海爆款新物种背后的黑科技
重保特辑|拦截99%恶意流量,揭秘WAF攻防演练最佳实践
What is the implementation principle of Go iota keyword and enumeration type
【pyqt5】自定义控件 实现能够保持长宽比地缩放子控件
Summer vacation second week wrap-up blog
Industry Salon Phase II丨How to enable chemical companies to reduce costs and increase efficiency through supply chain digital business collaboration?
SaaS管理系统的应用优势在哪里?如何高效提升食品制造业数智化发展水平?
重保特辑|筑牢第一道防线,云防火墙攻防演练最佳实践
Screenshot of Selenium in Remote
Zabbix6.0 DingTalk robot alarm