如果需求一定要在js的url中传递中文的话,必须对该中文进行处理。
例如从 A.jsp --> B.jsp
在JS里对中文参数进行两次转码
-------------------A.jsp中:
var name = encodeURI(encodeURI(data.msg[0].Bt));
$("#dwxxbt").html("<a class='dwxx' href='<%=url%>/pages/zph/zphGdcjqy.jsp?zphzj=<%=zphzj%>&zphBt="+name+"'>查看参加企业>></a>");
-------------------B.jsp中:
<%
String path = request.getContextPath();
String url = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path;
String zphBt = (String)request.getParameter("zphBt");
zphBt = java.net.URLDecoder.decode(zphBt,"utf-8");//decode string to chinese word
%>
<%=zphBt%>就可以正常显示了。