During project integration over the past two days, the encoding formats are different, and the data submitted by Ajax is garbled.
After reading the materials, add the red font (set the content encoding format)
Function modcomlevel (){
VaR parameters = "mode = savecomlavel ";
// Charge type
VaR level = $ ("# sellevel"). Val ();
Parameters + = "& level =" + level;
// Start time
VaR time = $ ("# txtbegindate"). Val ();
Parameters + = "& time =" + time;
// No.
VaR comid = $ ("# txtcomid"). Val ();
Parameters + = "& comid =" + comid;
$. Ajax ({type: "Post", datatype: "text ",Contenttype: "application/X-WWW-form-urlencoded; charset = UTF-8 ",URL: "agency/jspage/company. aspx ", data: parameters, success: function (data) {If ("-2 "= data) {alert (" O (random packet loss) O, sorry! The parameter you submitted is incorrect. Please submit it again ..... ");} else if ("-1 "= data) {alert (" Login timeout, please log on again "); document. location = "login. aspx ";} else if (" 1 "= data) {alert (" set successfully .... "); document. location = returnurl;} else if ("0" = data) {alert ("setting failed .... ") ;}}, error: function (data) {alert (" O (unknown) O, sorry! An error occurred while loading data. Please resubmit .....");}});
}