日期:2014-05-16 浏览次数:20344 次
$("#subForm").click(function() { var bookcaseId = $.trim($("#bookcaseId").val()); [color=red]bookcaseId = encodeURI(encodeURI(bookcaseId));[/color] //用了2次encodeURI if (bookcaseId) { var url = "../book!retrieveBillNo.action"; $.ajax( { url : url, cache : false, async : false, type : "POST", dataType : "json", success : function(data) { /* $("form").attr( "action", "choose.jsp?bookcaseId=" + bookcaseId + "&result=" + data.name); */ location.href = "choose.jsp?bookcaseId=" + bookcaseId + "&result=" + data.name; } }); } $("#bookcaseId").focus(); });
request.setCharacterEncoding("UTF-8"); String bookcaseId = request.getParameter("bookcaseId"); [color=red]bookcaseId = java.net.URLDecoder.decode(bookcaseId, "UTF-8");[/color] if (null != bookcaseId) { session.setAttribute("bookcaseId", bookcaseId); }