JS:
url = "http://...do?para=" + encodeURI(
encodeURI("中文"));//此处要编码两次!
xmlHTTP.open("POST",url,true);
Action:
String para = request.getParameter("para");
para = java.net.URLDecoder.decode(para, "UTF-8");
public static void writeStringToClient(HttpServletResponse response,
String strMsg) {
response.setContentType("text/html; charset=utf-8");
try {
response.getWriter().print(strMsg);
} catch (IOException e) {
e.printStackTrace();
}
}
用JS写了一个类似google searchBar的搜索条,就是因为这个问题困扰了半天
posted on 2008-11-25 13:01
adrian615 阅读(146)
评论(0) 编辑 收藏 所属分类:
ajax