js handles Chinese garbled characters


When js synthesizes the url, if the parameter is Chinese, it will be garbled when it is passed to struts2. The solution is as follows:
1. Use the encodeURI() method in the js file (two layers must be set).
login_name = encodeURI(encodeURI(login_name)); 

2.URLDecoder decodes
loginName = java.net.URLDecoder.decode(loginName,"UTF-8"); 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326459225&siteId=291194637