首页 > 代码库 > $.ajax如果success却得不到值

$.ajax如果success却得不到值


在使用$.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();