久久久久久久视色,久久电影免费精品,中文亚洲欧美乱码在线观看,在线免费播放AV片

<center id="vfaef"><input id="vfaef"><table id="vfaef"></table></input></center>

    <p id="vfaef"><kbd id="vfaef"></kbd></p>

    
    
    <pre id="vfaef"><u id="vfaef"></u></pre>

      <thead id="vfaef"><input id="vfaef"></input></thead>

    1. 站長資訊網(wǎng)
      最全最豐富的資訊網(wǎng)站

      jquery post中文亂碼怎么辦

      jquery post中文亂碼的解決辦法:1、前臺post請求的時候?qū)Πl(fā)送的數(shù)據(jù)進(jìn)行【encodeURIComponent()】編碼;2、后臺用【UTF-8】轉(zhuǎn)譯。

      jquery post中文亂碼怎么辦

      • 該方法適用于所有品牌電腦

      jquery post中文亂碼的解決辦法:

      前臺post請求的時候?qū)Πl(fā)送的數(shù)據(jù)進(jìn)行encodeURIComponent()編碼

      例如:

      var transactType= $("#transactType").attr("value"); var content=encodeURIComponent($("#content").html()); var title=encodeURIComponent($("#title").val()); $.post(       "${path}/transact!addTransact.action",  {"content":content,"title":title},  function(data){            if(data=='1'){                alert("保存成功!");                DG.cancel();             }else{                alert("保存失??!");           } } );

      后臺:

      UTF-8轉(zhuǎn)譯

      transactType = URLDecoder.decode(getStringParameter("transactType"),"UTF-8"); content =  URLDecoder.decode(getStringParameter("content"),"UTF-8"); title =  URLDecoder.decode(getStringParameter("title"),"UTF-8");

      即可解決jQuery post請求中文亂碼問題。

      相關(guān)學(xué)習(xí)推薦:js視頻教程

      贊(0)
      分享到: 更多 (0)
      網(wǎng)站地圖   滬ICP備18035694號-2    滬公網(wǎng)安備31011702889846號