jQuery transmits garbled Chinese parameters. The reason is that the default transmission method does not use UTF-8. Therefore, we can encode the parameters when passing them, and then operate them. The code is as follows. The red code is the passed parameter. Mark
smsubmitclick = function(){
$( document).ready(function(){
var name = $("#txt_name").val();
var type = $("#seltype option:selected").val();
var zjnum = $("#txt_num").val();
if(name == null || name ==="")
{
alert("Please enter your real name" );
; 🎜> . || zjnum == "")
{
alert("Please enter the ID number");
return false;
}
if(zjnum.length > 30)
{
alert("Sorry, there is something wrong with your ID, please re-enter"); ");
cache:false,
contentType: "application/x-www-form-urlencoded:charset=UTF-8",
url:"ajaxpage.aspx?t=smrz&name=" escape(name) "&zjtype=" escape(type) "&zjnum=" escape (zjnum) "",
dataType: "json",
🎜> })
}
})
}