url特殊字符处理

使用 encodeURIComponent() 对 URI 进行编码:
var uri="https://www.runoob.com/my test.php?name=Pad&Disk";
document.write(encodeURIComponent(uri));
 
后端解码:
String str= StringEscapeUtils.unescapeHtml(name);
 
posted @ 2022-03-31 10:28  C&L  阅读(43)  评论(0)    收藏  举报