ASP+AJAX用request获取参数的中文值不到
tcmis 2009-07-28 08:59:49 碰到一个奇怪的问题, 我用ASP+AJAX用request获取参数的中文值不到,为空,传数字和字母都可以获取到,
用js显示的时候是有值, 并且显示不是乱码。到asp页面就获取不到中文值了,不知道原因,搞了很久都没有找到原因
大侠们看看什么原因。谢谢了。
function getEmployee(name){
request = createXmlHttpRequestObject();
var url = "../employee/getEmployeeAJAX.asp?name="+name+"&r="+getRandom();
alert(url);
request.open("GET", url, true);
showLoading();
request.onreadystatechange = getEmployeeResult;
request.send(null);
}
<%
Session.CodePage=65001
%>
<!--#include file="../../com/conn.asp" -->
<!--#include file="../../com/jrosion.asp" -->
<%
dim name, result
name = request("name") '这个地方只能获取数字和字母的值。
sql = "select pk, name from V_EMPLOYEE where name = '"&name&"'"
set ds = conn.execute(sql)
if (not ds.eof) then
while (not ds.eof)
result = result&ds("pk")&"^"&ds("name")&"~"
ds.movenext()
wend
end if
response.Write(result)
%>