$('#login').click(function(){ var myname; myname=escape($("#uname").val()); // escape 转码 这个很重要,防止中文字符乱码 $.ajax({ url:"getResult.asp",type:"POST",data:"name="+myname,success: function(msg){ $(".conter").html(msg); } }) })
getResult.asp
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%> <% Response.ContentType = "text/html" Response.Charset="gb2312" response.cachecontrol="no-cache" response.addHeader "pragma","no-cache" response.expires=-1 response.expiresAbsolute=now-1 msg=unescape(Request("name")) 'unescape 解码 这个很重要 response.write msg %>