当前位置:网站首页>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直播源码,点击搜索栏自动弹出下拉框,更多内容欢迎关注之后的文章
边栏推荐
- LeetCode 1374. Generate an odd number of each character string
- kubernetes-部署nfs存储类
- The life cycle and scope
- WinRAR | 将多个安装程序生成一个安装程序
- [Server data recovery] Data recovery case of offline multiple disks in mdisk group of server Raid5 array
- ACID Characteristics and Implementation Methods of MySQL Relational Database Transactions
- Map by value
- 基于flowable的upp(统一流程平台)运行性能优化
- #yyds dry goods inventory# Interview must brush TOP101: the last k nodes in the linked list
- 重保特辑|筑牢第一道防线,云防火墙攻防演练最佳实践
猜你喜欢

C#/VB.NET: extracted from the PDF document all form

Redis的内存淘汰策略和过期删除策略的区别是什么

力扣刷题之移动零

Keras deep learning practice - traffic sign recognition

力扣刷题之合并两个有序数组

#yyds dry goods inventory# Interview must brush TOP101: the last k nodes in the linked list

生命周期和作用域

Prometheus's Recording rules practice

kubernetes-部署nfs存储类
![[Kapok] #Summer Challenge# Hongmeng mini game project - Sudoku (3)](/img/8d/4f5f7c2463b781cba1c68370d3c29c.png)
[Kapok] #Summer Challenge# Hongmeng mini game project - Sudoku (3)
随机推荐
Map传值
SQL函数 TO_DATE(一)
Goldfish Brother RHCA Memoirs: CL210 manages OPENSTACK network -- network configuration options
突破性能天花板!亚信数据库支撑 10 多亿用户,峰值每秒百万交易
Multi-Party Threshold Private Set Intersection with Sublinear Communication-2021:解读
Tencent Cloud Hosting Security x Lightweight Application Server | Powerful Joint Hosting Security Pratt & Whitney Version Released
Redis的内存淘汰策略和过期删除策略的区别是什么
C#/VB.NET:从 PDF 文档中提取所有表格
【pyqt5】自定义控件 实现能够保持长宽比地缩放子控件
[National Programming] "Software Programming - Lecture Video" [Zero Basic Introduction to Practical Application]
Live chat system technology (8) : vivo live IM message module architecture practice in the system
C#/VB.NET:从 PDF 文档中提取所有表格
2022年 PHP面试问题记录
Become a Contributor in 30 minutes | How to participate in OpenHarmony's open source contributions in multiple ways?
Selenium在远程中的截图
Heavy cover special | build the first line of defense, cloud firewall offensive and defensive drills best practices
ExcelPatternTool: Excel form-database mutual import tool
Stop using MySQL online DDL
在Map传值与对象传值中模糊查询
odoo+物联网