[Jquer] When using the serialize() method in jquer to get the value in the form, the Chinese characters are garbled

Reference link: https://www.cnblogs.com/huangshuqiang/p/5710230.html

Garbled reason: serialize() automatically called the encodeURIComponent method to encode the data.
Solution: call decodeURIComponent(XXX,true); to decode the data.

E.g:

var params = jQuery("#formId").serialize(); // http request parameters.   
5 params = decodeURIComponent(params,true); 

Guess you like

Origin blog.csdn.net/Black_Customer/article/details/107517646