window.location.href 中文乱码问题。。。。

要解决此问题需要两次解码,

  第一次解码:

    是在页面中的js脚本中解码:window.location.href = "saveCl.action?clflname="+encodeURI(encodeURI(clflname)) ;

  第二次解码:

    是在Java程序中进行二次解码:String clflname1 = java.net.URLDecoder.decode(clflname, "UTF-8");

此时经过两次解码之后,从页面传过来的clflname解码之后变为clflname1,此时clflname1就是中文了

window.location.href 中文乱码问题。。。。的更多相关文章

  1. window.location.href url含中文服务器收到乱码问题解决

    中文乱码问题 window.location.href url含中文服务器收到乱码问题解决 (1).页面中先对中文进行编码. 如:window.location.href = url+"&a ...

  2. window.location.href 传参中文乱码问题!!!

    不是所有地方都会用Ajax  当你使用window.location.href 来传中文参数的时候 如何避免乱码问题 js 是这样写的    下面代码中  方式 封装编码  参数 username  ...

  3. 关于window.location.href 传中文参数 乱码问题

    传中文查询乱码问题 则需要对要传的参数进行二次编码 例如  window.location.href ="/xx.jsp?name="+name+""; 这样子 ...

  4. window.location.href下载文件,文件名中文乱码处理

    下载文件方法: window.location.href='http://www.baidu.com/down/downFile.txt?name=资源文件'; 这种情况下载时:文件名资源文件会中文乱 ...

  5. javaweb使用 window.location.href 传中文参数 乱码问题

    JS: var cn_name=  document.getElementById("cn_name"); window.location.href="${URL}?na ...

  6. window.location.href url含中文乱码问题

    (1).页面中先对中文进行编码. 如:window.location.href = url+"&groupName=" + encodeURI(encodeURI(grou ...

  7. window.location.href后携带参数

    JS文件中: window.location.href后可携带参数,但是不安全,虽然在技术上是可以实现的 1.传参:window.location.href = "RecordCare.as ...

  8. window.top.location.href 和 window.location.href 的区别

    "window.location.href"."location.href"是本页面跳转. "parent.location.href" 是 ...

  9. 关于js中window.location.href,location.href,parent.location.href,top.location.href的用法

    "window.location.href"."location.href"是本页面跳转 "parent.location.href"是上一 ...

随机推荐

  1. JIRA FOR LINUX 安装过程

    1.Download 官网下载地址:https://www.atlassian.com/software/jira/download,只看到window下的安装版本,这个时候需要点击? All JIR ...

  2. GCC编译过程

    以下是C程序一般的编译过程: gcc的编译流程分为四个步骤,分别为:· 预处理(Pre-Processing) 对C语言进行预处理,生成*.i文件.· 编译(Compiling) 将上一步生成的*.i ...

  3. kettle系列-kettle管理平台部署说明

    本介绍我的开源项目[kettle-manager]kettle管理平台如何获取并部署使用,该项目介绍请参看另一篇博文:http://www.cnblogs.com/majinju/p/5739820. ...

  4. android的消息处理机制——Looper,Handler,Message

    在开始讨论android的消息处理机制前,先来谈谈一些基本相关的术语. 通信的同步(Synchronous):指向客户端发送请求后,必须要在服务端有回应后客户端才继续发送其它的请求,所以这时所有请求将 ...

  5. SQL谜题(楼层谜题)

    Multiple DwellingsBaker, Cooper, Fletcher, Miller and Smith live on different floors of an apartment ...

  6. Python-socket网络编程

    一.计算机网络 多台独立的计算机用网络通信设备连接起来的网络.实现资源共享和数据传递.比如,我们之前的学过的知识可以将D盘的一个文件传到C盘,但如果你想从你的电脑传一个文件到我的电脑上目前是做不到的; ...

  7. CozyRSS开发记录13-添加订阅的对话框

    CozyRSS开发记录13-添加订阅的对话框 1.设计对话框 首先,还是先用MockPlus来画个原型图: 因为用了MaterialDesignToolkit,那么可以很方便的有一个蒙层的效果. 2. ...

  8. python学习6 web开发

    wsgi自带,用语构建简单服务器 例子 from wsgiref.simple_server import make_server def index(env, res): res('200 ok', ...

  9. Codeforces CF#628 Education 8 C. Bear and String Distance

    C. Bear and String Distance time limit per test 1 second memory limit per test 256 megabytes input s ...

  10. 在CentOS 7中安装与配置JDK8

    参考命令:http://www.jb51.net/os/RedHat/73016.html来进行安装 安装说明 系统环境:centos7 安装方式:rpm安装 软件:jdk-8u25-linux-x6 ...