我在web.config的<system.web>节点下已经配置了
<globalization requestEncoding="gb2312" responseEncoding="gb2312" culture="zh-CN"/>
但是用ajax传参的时候,还是挂掉了,乱码。。。。
js调试的时候,参数无乱码,传到一般处理程序就乱码,但是在地址栏直接敲入中文参数是没有乱码的!
什么情况?
function StopButton() {
document.getElementById(arguments[0]).disabled = true;
document.getElementById(arguments[0]).value = "提交(" + arguments[1] + ")";
if (--arguments[1] > 0) {
window.setTimeout("StopButton('" + arguments[0] + "'," + arguments[1] + ")", 1000);
}
if (arguments[1] <= 0) {
document.getElementById(arguments[0]).value = '提交';
document.getElementById(arguments[0]).disabled = false;
}
}
function SendComment() {
var commentuser = $("input#CommentUser").val().trim();
var commenttext = $("textarea#CommentText").val().trim();
if (commentuser == "" && commenttext == "") {
$("div#warning")("<font color='red'>内容为空!<br />昵称为空!</font>");
return false;
}
if (commentuser == "") {
$("div#warning")("<font color='red'>昵称为空!</font>");
return false;
}
if (commenttext == "") {
$("div#warning")("<font color='red'>内容为空!</font>");
return false;
}
$("div#warning")("");
$.ajax({
url: "addcomment.ashx?commentuser=" + commentuser + "&commenttext=" + commenttext,