1.在js 中 对参数 input进行编码
escape(escape(input))
2.接收参数进行解码
string txtID = System.Web.HttpUtility.UrlDecode(Request["input"]);
第二种方式:encodeURIComponent(input)
本文介绍了JavaScript中两种参数编码的方法:使用escape函数两次对输入进行编码,以及使用encodeURIComponent函数。同时提供了如何通过System.Web.HttpUtility.UrlDecode进行解码的例子。
1.在js 中 对参数 input进行编码
escape(escape(input))
2.接收参数进行解码
string txtID = System.Web.HttpUtility.UrlDecode(Request["input"]);
第二种方式:encodeURIComponent(input)

被折叠的 条评论
为什么被折叠?