读书人

jquery ajax 回调函数 返回乱码?解决

发布时间: 2012-03-31 13:13:26 作者: rapoo

jquery ajax 回调函数 返回乱码?

JScript code
 var url = "login?userName=" + encodeURI(encodeURI($("#userName").val()));    url = convertURL(url);    $.get(url,null,function(data){                alert(decodeURI(data));        $("#result").html("<font color=red>"+decodeURI(decodeURI(data))+"</font>");});

PrintWriter out=response.getWriter();
response.setContentType("text/html;charset=utf-8");
out.print("用户名不存在");

我都设为utf-8了 还是 返回????

[解决办法]
html
后台
文件 编码需一致

读书人网 >JavaScript

热点推荐