url中传参数为中文的转码与解码解决方法
作者:互联网
1.转码
中文为 “你好”
var ProjectName = encodeURI(encodeURI("你好"));,如下图所示
跳转页面 window.location.href="/ProjectManagement/ProjectManagement/ViewProjectsDetails?ProjectName=" + ProjectName;
2.解码
获取ProjectName
var ProjectName = $.request("ProjectName"));
var aa = decodeURI(ProjectName );
console.log(aa); //你好
标签:aa,ProjectManagement,中传,转码,url,ProjectName,var,encodeURI 来源: https://www.cnblogs.com/quitpoison/p/10973065.html