One, the request to use the Post method does not need to consider the coding problem.
Second, front and rear unified code, support Chinese, regardless of the encoding; Tomcat UTF-8 encoding
Third, the front and back of the code is not unified
$.ajax ({
URL: "Maintain/saveresourceinfodesaction.action?imagepath=" +imagepath,
Type: ' Get ',//Data send method
data:{"Ftitle": Ftitle, "htmlcontent": Htmlcontent, "Titleimgs": Inputtitle.tostring ()},
Async:true,//Async
DataType: ' JSON ',
Success:this.saveResInfoSuccess,
Error:function () {alert (' failed to publish ');}
});
ImagePath requires two encoding encodeURI (encodeURI (ImagePath)) in the URL, background imagePath = Urldecoder.decode (ImagePath, "UTF-8"); To obtain the correct value;
Ftitle only one time encoding encodeURI (ftitle) Background ImagePath = Urldecoder.decode (Ftitle, "UTF-8"); You can get the right value
JS, Java Pass-value encoding