J2EE 0.7.2—用ajax实现像google那样的suggest-search功能(简化版)
首先是需要建一个库。考虑可以这样。建立一个拼音的字段对应汉字的,用户打简拼即可查出汉字
- <body?onclick='hideSearchSuggest()'>??
- ????<html:form?action="/searchSuggestAction"?method="POST">??
- ????<bean:define?id='form'?name='searchSuggestForm'?type='org.perfect.struts.form.SearchSuggestForm'>??
- ????bean:define>??
- ???? ??
- ????<fieldset><table><tr>??
- ???????<td?class="free_input"><input?type='text'?name="title"?size='80'?onkeyup="testPrototype();"?autocomplete="off"/>td>??
- ???????<td><span?style='font-size:12'>搜索span>td>??
- ????tr>table>??
- ???????? ??
- ????fieldset>??
- ????<div?id="search_suggest">div>??
- ???? ??
- ????html:form>??
- ??body>??
- html>??
没啥东西。基本上很简单。不过也搞了三四个小时才搞得定。
全靠谷老哥了。
不晓得没了他我能不能自己独立写点东西。