jquery的ajax向后台提交时,乱码的解决方案

1. 可以给每个参数加上encodeURIComponent(),然后在后台获得参数后用URLDecoder.decode(string, 'utf-8')解码。

2. 后台不用解码。

              $.ajax({
                   url : '',
                   type : 'post',
                   contentType: "application/x-www-form-urlencoded; charset=utf-8", 
                   data : {
                       serialNum : serialNum,
                       conditionString : conditionString,
                   },
                   success : function(msg){
                       alert(msg);
                   },
                   error : function(msg){
                       alert(msg);
                   }
               });
原文地址:https://www.cnblogs.com/qlong8807/p/3499682.html