js页面跳转(window.location.href)乱码问题
在JS跳转时,中文传参时常会遇到乱码问题,现有一个解决办法,可以试试:
1 JS代码
1 attrs += "&_query._name="+encodeURIComponent(name);
2 Action转码
1 _name = new String(_name.getBytes("ISO8859-1"), "UTF-8");
在JS跳转时,中文传参时常会遇到乱码问题,现有一个解决办法,可以试试:
1 JS代码
1 attrs += "&_query._name="+encodeURIComponent(name);
2 Action转码
1 _name = new String(_name.getBytes("ISO8859-1"), "UTF-8");