$(function(){ $(":text[name=name]").keyup(function(){ var val = this.value; $.get("abc",{"username":val,"age":123},callback); }); }); function callback(data){
public List<String> getList(String name){ List<String> list = new ArrayList<String>(); try { String sql = "select name from inf where name like '%"+name+"%'"; pst = getConn().prepareStatement(sql); rs = pst.executeQuery(); while(rs.next()){ list.add(rs.getString("name")); } } catch (Exception e) { e.printStackTrace(); } return list;