当前位置:网站首页>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直播源码,点击搜索栏自动弹出下拉框,更多内容欢迎关注之后的文章
边栏推荐
- 【神经网络】一文带你轻松解析神经网络(附实例恶搞女友)
- odoo coding conventions (programming conventions, coding guidelines)
- 选择合适的 DevOps 工具,从理解 DevOps 开始
- Screen: GFF, OGS, Oncell, Incell of full lamination process
- Multi-Party Threshold Private Set Intersection with Sublinear Communication-2021:解读
- 腾讯云主机安全 x 轻量应用服务器|强强联合主机安全普惠版重磅发布
- 从普通进阶成优秀的测试/开发程序员,一路过关斩将
- The life cycle and scope
- What is the JVM runtime data area and the JMM memory model
- ExcelPatternTool: Excel表格-数据库互导工具
猜你喜欢

力扣刷题之求两数之和

A simple Flask PIN

文库网站建设源码分享

GZIPOutputStream 类源码分析

Fuzzy query in Map pass-by-value and object pass-by-value

无需破解,官网安装Visual Studio 2013社区版

Keras深度学习实战——交通标志识别

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

在表格数据上,为什么基于树的模型仍然优于深度学习?

Leetcode73. Matrix Zeroing
随机推荐
Heavy cover special | build the first line of defense, cloud firewall offensive and defensive drills best practices
Leetcode74. Search 2D Matrix
暑假第二周总结博客
生命周期和作用域
#yyds干货盘点# 面试必刷TOP101: 链表中倒数最后k个结点
C#/VB.NET: extracted from the PDF document all form
Industry Salon Phase II丨How to enable chemical companies to reduce costs and increase efficiency through supply chain digital business collaboration?
在Map传值与对象传值中模糊查询
Multi-Party Threshold Private Set Intersection with Sublinear Communication-2021:解读
How to build a CMDB driven by consumption scenarios?
modbus总线模块DAM-8082
金鱼哥RHCA回忆录:CL210管理OPENSTACK网络--网络配置选项
随时随地写代码--基于Code-server部署自己的云开发环境
文库网站建设源码分享
Become a Contributor in 30 minutes | How to participate in OpenHarmony's open source contributions in multiple ways?
mysql函数的作用有哪些
深入浅出Flask PIN
Shell script topic (07): file from cfs to bos
日志工厂(详细)
odoo coding conventions (programming conventions, coding guidelines)