当前位置:
代码迷
>>
Java Web开发
>> js中encodeURIComponent转码后到后盾直接输出 变成乱码
详细解决方案
js中encodeURIComponent转码后到后盾直接输出 变成乱码
热度:
73
发布时间:
2016-04-16 23:55:01.0
js中encodeURIComponent转码后到后台直接输出 变成乱码
前台用js的encodeURIComponent转码后,在前台输出一下 是%16进制码 但是到后台,也是直接输出,并没有再转码,但是却变成乱码,请问这是什么情况呢?
------解决方案--------------------
在JS中需要转码2次,在后台在解码
conditions=encodeURI(conditions);
conditions=encodeURI(conditions);//必须要转码2次
查看全文
相关解决方案
img.src = "SChart.aspx?now="+ now +"sqlWhere ="+encodeURIComponent(_sqlWhere);该怎么处理
转:javascript 惯用的编码escape(), encodeURL(), encodeURIComponent() 区别
js的escape()、encodeURI()、encodeURIComponent()差异详解
js 中escape encodeURI encodeURIComponent