query form表单.serialize()序列化后中文乱码原因
.serialize()自动调用了encodeURIComponent方法将数据编码了
解决方法如下
调用decodeURIComponent(XXX,true);将数据解码
例子如下
var params = $("#formId").serialize();
//由于serialize()方法进行了encodeURIComponent方法编码,所以这里打印params的话,你会看见中文乱码。
params = decodeURIComponent(params,true);
//使用decodeURIComponent(进行解码,中文即可正常显示。
参考链接 https://blog.csdn.net/fzy629442466/article/details/84786049