JS, Java Pass-value encoding

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.