87,910
社区成员
发帖
与我相关
我的任务
分享
var data = $("#myForm").serialize();
//实际上serialize()方法会将中文编码一次,提交时再用encodeURI方法将data再编码一次:
$.ajax({
async : false,
type : "post",
dataType : "json",
url : url + "&" + encodeURI(data),
contentType : "application/x-www-form-urlencoded; charset=utf-8",
success : function(result) {
reflashTable(result);
},
error : function(XMLHttpResponse) {
alert("出错了。");
}
});
public void setPlayername(String playername) {
try {
this.playername = playername == null ? null : java.net.URLDecoder.decode(playername.trim(), "UTF-8");
} catch (UnsupportedEncodingException e) {
System.out.println("setPlayername decode utf-8 Error!");
}
}