Home >Backend Development >PHP Tutorial > jquery post传值乱码?该怎么处理

jquery post传值乱码?该怎么处理

WBOY
WBOYOriginal
2016-06-13 13:48:08707browse

jquery post传值乱码??????

JScript code
<!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

-->var t=null;    
var save=function(o){
    $("#loading").html('正在保存..');
    var x=$('#saveContact_'+o).offset().left-15;
    var y=$('#saveContact_'+o).offset().top-10;
    $("#divMsg").css({display:'block',"left":x+'px',"top":y+'px'});
    var corpid='';
    var contactid=$("input[name='ContactID["+o+"]']").val();    
    var psnamea=$("input[name='psnamea["+o+"]']").val();
    var psgendera=$("select[name='psgendera["+o+"]']").val();
    var psagea=$("input[name='psagea["+o+"]']").val();
    var ctbirthday=$("input[name='ctbirthday["+o+"]']").val();
    var psrolea=$("select[name='psrolea["+o+"]']").val();
    var pspositiona=$("input[name='pspositiona["+o+"]']").val();
    var mobile=$("input[name='mobile["+o+"]']").val();
    var email1=$("input[name='email1["+o+"]']").val();
    var psdetaila=$("input[name='psdetaila["+o+"]']").val();
    var psadra=$("input[name='psadra["+o+"]']").val();
    var cttel=$("input[name='cttel["+o+"]']").val();
    //var defaultprint=$("input[name='isprintisprint["+o+"]']").val();DefaultPrint:defaultprint,
    var lastmodify='';
    var url = "/?p=ContactInfo&action=UpdatePs";
    //alert(defaultprint);
    url += "&datetime=" + new Date().getTime();
    $.post(url,{Action:"POST",Modify_UserID:lastmodify,ContactID:contactid,CorpID:corpid,CtName:psnamea,PsSex:psgendera,CtAge:psagea,CtBirthday:ctbirthday,CtPosition:psrolea,PositionDetail:pspositiona,CtMobile:mobile,PsEmail:email1,CtDetail:psdetaila,CtAdr:psadra,CtTel:cttel},function(data,text){
            $("#loading").html(data);            
            t=setTimeout('clearMsg()',1000);
            //alert(data);
        },"text"); 
};
如何解决??????????

------解决方案--------------------
encodeURI("你要传的值"),看下我发的这个帖子:http://topic.csdn.net/u/20110929/17/3b20dbbf-1525-4527-a364-a9c15977030d.html
------解决方案--------------------
http://blog.csdn.net/youlianying/article/details/5766148
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn