ajax返回值data乱码

                       

1.在页面设置编码格式

<%@ page contentType="text/html; charset=UTF-8"%> 和<meta charset="utf-8"/>
   
   
  • 1

2.后台返回值之前添加

 response.setContentType("text/xml;charset=UTF-8");        response.setHeader("Cache-Control", "no-cache");        response.setCharacterEncoding("UTF-8");
   
   
  • 1
  • 2
  • 3
           

猜你喜欢

转载自blog.csdn.net/qq_44949818/article/details/89474098
今日推荐