2010-03-30 35 views
2

ajax(搜索建议),如果输入有趣的字符(如Ô)并提交它,“?”显示在*****。asp中。 (回复于(的Request.Form( “STR”)))ajax(搜索建议)有趣的人物问题

我使用

xmlhttp.open("post", "*****.asp", true); 
xmlhttp.setRequestHeader('Content-type','application/x-www-form-urlencoded; charset=UTF-8'); 
xmlhttp.send("str="+escape($("str").value)); 

并有<%@CODEPAGE=65001%>*****.asp文件

我怎样才能得到正确的字--- “Ô”in *****.asp

+0

这个问题在函数escape()上。有趣的字符(Ô)被编码 – Jason 2010-03-31 09:11:52

回答

0

escape()很糟糕,不惜一切代价避免它。试试这个:

xmlhttp.send("str="+encodeURIComponent($("str").value)); 

这将编码Ô到%C3%94 - 假设解码支持UTF8你应该罚款的页面。