Jquery.autocomplete 的使用
/** *修改人:yanghui@cotel@.com.cn *修改内容:GGSN IP 联想 *修改时间:2010-06-10*/$(document).ready(function(){getIPData = function(keyword) {var data = null;$.ajax({ type: "post", url: "${pageContext.request.contextPath}/NetWorkManageAction.do?method=ipHistory", data: "keyword=" + keyword, async: false, success: function(msg){ var message = new Function("return" + msg); data = message(); }}); return data;};$("#ip").autocomplete(getIPData($(this).val()), {minChars: 1,max: 10,width: 250,selectFirst:false,matchContains:false,scrollHeight: 220,scroll: false,delay:100, formatItem: function(row, i, max) { // alert(row.ip); return row.ip + "<font color='green'> [" + row.count +"]</font>"; },formatResult: function(row) {return row.ip;}});});