如何通过简单的文本文件开发自动完成搜索框 [英] How to develop an autcomplete search box from a simple text file

查看:75
本文介绍了如何通过简单的文本文件开发自动完成搜索框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我必须使用php在网站中开发一个搜索框.
我在文本文件"products.txt"中大约有1000种产品列表.此列表永远不会更改.我想在搜索框中使用此列表来实现自动完成功能.
我想当用户在搜索框中输入任何字符时,自动完成功能会从products.txt获取相关数据.
我不想让数据库参与自动完成过程.因为我的名单永远不会改变.

因此,有什么方法可以实现我的目标.

I have to develop a search box in site using php.
I have about 1000 products list in a text file "products.txt". This list will not change ever. I want to use this list in a search box for autocomplete purpose.
I want, when user enter any character in the search box, the autocomplete function get the relevant data from the products.txt.
I don''t want to involve the database in autocomplete process. Because my list will not change ever.

So, Is there any way to achieve my target.

推荐答案

检查这些

自动完成控制 [无需网络服务的JQuery + ASP.NET自动完成 [ ^ ]
Check these

Auto-complete Control[^]
JQuery + ASP.NET auto complete without web service[^]


这篇关于如何通过简单的文本文件开发自动完成搜索框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆