The null solution is obtained by passing Chinese parameters in Ajax.

Source: Internet
Author: User

Client:

Function processresponseextends (){
If (XMLHTTP. readystate = 4 & XMLHTTP. Status = 200 ){
// Fill in the mobileuaextendsdiv content again
Alert (XMLHTTP. responsetext );
$ ("Mobileuaextendsdiv"). innerhtml = XMLHTTP. responsetext;
}
}
Function showua_extends (mobiletypename ){
// Alert ("@ 111:" + mobilebrandid );
Alert ("mobiletypename:" + mobiletypename );
Createxmlhttp ();
XMLHTTP. onreadystatechange = processresponseextends;
VaR url = "<% = basepath %> game/getuadata? Operator = showuaextends & mobiletypename = "+ mobiletypename;
Alert ("url:" + URL );
Url = encodeuri (URL );
Url = encodeuri (URL );
Alert ("encodeuri URL:" + URL );
XMLHTTP. Open ("Post", URL, true );
XMLHTTP. Send (null );
}

 

Server:

Log. debug ("111111111111111111 mobiletypename:" + request. getparameter ("mobiletypename "));
String mobiletypename = request. getparameter ("mobiletypename ");
Mobiletypename = java.net. urldecoder. Decode (mobiletypename, "UTF-8 ");
Log. debug ("222222222222222222 mobiletypename:" + mobiletypename );

 

This solves the problem of passing Chinese parameters.

Related Article

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.