在openface开发环境下,我测试了encodeURIComponent函数都不能转化(可能不支持),encodeURI 、escape方法可以转化,但是有转化的字符限制
最多使用的应为encodeURIComponent,它是将中文、韩文等特殊字符转换成utf-8格式的url编码,所以如果给后台传递参数需要使用encodeURIComponent时需要后台解码对utf-8支持(form中的编码方式和当前页面编码方式相同)
escape不编码字符有69个:*,+,-,.,/,@,_,0-9,a-z,A-Z
encodeURI不编码字符有82个:!,#,$,&,',(,),*,+,,,-,.,/,:,;,=,?,@,_,~,0-9,a-z,A-Z
encodeURIComponent不编码字符有71个:!, ',(,),*,-,.,_,~,0-9,a-z,A-Z


<html> <script> function getssList() { str = "//content#";//原始字符串 str = encodeURIComponent(str); alert(str); } </script> <body> <input type="button" name="sslist" value="转化" onclick="getssList()"> </body> </html>在网页做了测试没有问题