让脚本自动完成器表现得像谷歌即时
您知道,当您开始在自动完成搜索框中搜索时,您会得到可能结果的列表。从这些结果中,假设您单击列表中的某个项目,我想获取该项目并执行另一次搜索以提供另一个结果列表。就像谷歌的工作方式一样。如果您不明白我的意思,请尝试在谷歌搜索框中输入“ja”之类的内容。它将给出可能结果的列表,当您选择其中一个结果时,它会进行另一次搜索并给出另一组结果。
请问有人知道如何使用脚本自动完成来做到这一点吗?或任何其他方式网上的任何例子,我都会非常感激。
顺便说一下,我正在使用 codeigniter 框架(php)
You know when you start searching in an autocomplete search box, you get a list of possible results. From those results, say you click one of the items on the list, I want to take that item and perform another search to give another list of results. Just exaclty like how google works. if you dont understand me try typing into google search box something like 'ja'. It will give a list of possible results,when you select one of them, it does another search and gives another set of results.
Pls does anyone know how to do this with scriptalous autocomplete? or anyother way Any example on the net, will really really appreciate it.
I ma using codeigniter frame work (php) by the way
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你绝对可以做到。就我个人而言,我会使用 jQuery UI 中的自动完成功能在 jQuery 中完成此操作。
http://jqueryui.com/demos/autocomplete/
你可以让它加载像这样的结果通常会这样做,但会以不同的方式格式化它们或扩展 jquery ui。会相当简单。
由于它在 jQuery 中是可能的,所以它绝对可以使用 scriptaculous 自动完成器来完成,但我不熟悉它。
您将查看显示输出的位置:
如果您可以按照您想要的方式设置其样式,而不是像下拉菜单那样,那么您将立即得到。
You can definitely do it. Personally I would do it in jQuery using the Autocomplete from jQuery UI.
http://jqueryui.com/demos/autocomplete/
You could get it to load the results like it usually does but format them differently or extend the jquery ui. Would be fairly simple.
Since its possible in jQuery its definitely possible to do with the scriptaculous autocompleter but I am not familiar with it.
You would look at the place where the output is displayed:
If you can style this the way you want it instead of it being like a dropdown then you will have your instant.