jQuery中文乱码解决方案
时间:2011-03-05 来源:蔺文龙
contentType:"application/x-www-form-urlencoded; charset=UTF-8"参数,如:
$.ajax({
type: "post",
url: "/my/login.aspx",
data: $('#loginform').serialize(),
dataType: "json",
contentType:"application/x-www-form-urlencoded; charset=UTF-8",
success: function (json) {
if (json.statusCode == 200) {
window.location.reload();
} else {
$("#J_logininfo").attr("class", "fail").html(json.message);
}
},
beforeSend: function (o) {
$("#J_logininfo").attr("class", "focus").html("登录中...");
}
});
相关阅读 更多 +