ajax get提交方式中文乱码问题

    xiaoxiao2021-03-25  173

    js代码

    $("#acc").blur(function(){

    var accTem = $('#acc').val(); var acc = encodeURIComponent(encodeURIComponent(accTem)); $.get("UserServlet?acc="+acc,function(data,status){ alert(data); });

    });

    servlet代码

    String accTem = request.getParameter("acc"); String acc = URLDecoder.decode(accTem, "utf-8");

    转载请注明原文地址: https://ju.6miu.com/read-1208.html

    最新回复(0)