使用jQuery autocomplete传递中文参数后台用request.getParameter("q");
取数据默认会是乱码,
可以在jquery.autocomplete.js 中大概第384行lastWord(term)进行编码 如下
$.ajax({
// try to leverage ajaxQueue plugin to abort previous requests
type:'post',
mode: "abort",
// limit abortion to this input
port: "autocomplete" + input.name,
dataType: options.dataType,
url: options.url,
data: $.extend({
q: encodeURI(lastWord(term)),
limit: options.max
......
阅读全文