var contents = encodeURIComponent(document.getElementById("content-"+id).value); //var contents = document.getElementById("content-"+id).value; var castellanId = document.getElementById("castellan-"+id).value; alert(contents); if (handleType == 'read') { $.post('handleSuggestDomainAction.action', { sbt: 'sbrd', content: contents, cid: castellanId, sgId: id }, function() { //alert('哈哈.回复/处理成功!'); window.location.href =window.location.href; window.location.href.reload(); //window.location.reload(); }); }
环境: Jquery1.3.2 ,Struts2
页面:
jsp中,改成红色显示的那样
var contents = encodeURIComponent(document.getElementById("content-"+id).value);
服务器端:
contentCn = URLDecoder.decode(content, "UTF-8");
乱码解决..
以前记得要页面上 encode 2次的.貌似记错了?