在使用$.ajax做异步调用的时候,如果success却得不到值
$.ajax({ type:"GET", url:tourl, cache:false, data:"{}", success:function(data){ alert(data); } });
后台这样写的不到值
PrintWriter out = ServletActionContext.getResponse().getWriter(); out.print(msg); out.flush(); out.close();
如果该改成这样就可以了
HttpServletResponse response = ServletActionContext.getResponse(); response.setCharacterEncoding("UTF-8"); PrintWriter out = response.getWriter(); out.print(msg); out.flush(); out.close();
$.ajax如果success却得不到值,布布扣,bubuko.com
原文:http://blog.csdn.net/myfmyfmyfmyf/article/details/32124435