window.location.href传递汉字参数
2017-02-08 16:55
351 查看
前台传递参数:
window.location.href = GetPageName() + "?category_id=" + _category_id + "&recommend=" + _recommend + "&word=" + encodeURI(encodeURI(_word));
word是中文,客户端编码两次,服务端解码一次
C#代码:
_word = HttpUtility.UrlDecode(Request["word"], System.Text.Encoding.UTF8);
前台获取uri字符串需解码:
_word = GetQueryString("word") == null ? "" : GetQueryString("word");
$("#text_query").val(decodeURI(_word));
原文来自:点击打开链接
window.location.href = GetPageName() + "?category_id=" + _category_id + "&recommend=" + _recommend + "&word=" + encodeURI(encodeURI(_word));
word是中文,客户端编码两次,服务端解码一次
C#代码:
_word = HttpUtility.UrlDecode(Request["word"], System.Text.Encoding.UTF8);
前台获取uri字符串需解码:
_word = GetQueryString("word") == null ? "" : GetQueryString("word");
$("#text_query").val(decodeURI(_word));
原文来自:点击打开链接
相关文章推荐
- Window.location.href以post方式传递参数的方法
- window.location.href以post方式传递参数
- window.location.href 跳转页面时传递参数并且在新页面接收参数
- Window.location.href以post方式传递参数的方法
- html中使用window.location.href()跳转和传递参数。
- window.location.href传递js对象参数及获取参数
- javaweb使用 window.location.href 传中文参数 乱码问题
- window.location传递参数
- window.location.href跳转页面,问号传参并将参数转为json对象
- window.location.href()采用post传递数据
- JS控制静态页面之间传递参数获取参数并应用(window.location)
- window.location.href()采用post传递数据
- jsp html中 window.location.href动态添加参数
- window.location.href 带参数跳转 如何获取值(解决)
- js获取url传递参数,js获取url?号后面的参数window.location
- JQuery中Ajax的Post提交中文乱码、windows.location.href 中文汉字乱码和springmvc使用原生态HttpServletRequest接收参数中文乱码解决办法
- js获取url传递参数,js获取url?号后面的参数window.location
- window.location.href后面的url带多个参数
- JavaScript各种定向携带参数传值问题。(window.location.href)
- js获取url传递参数,js获取url?号后面的参数window.location