input输入时自动联想
$("#orgName").bind('input propertychange',function(){ var words = $("#orgName").val(), url = "/member2/person/searchOrg"; $.ajax({ type: 'POST', url: url, data: {keys:words}, dataType: 'json', success: function(data){ if(data.code = 1000){ //显示结果 /*var obj = data.data, str = ''; for(i in obj){ str += obj[i]; }*/ } } }); });