encodeURI、encodeURIComponent、decodeURI、decodeURIComponent

147 阅读1分钟

juejin.cn/post/684490…

用来编码和解码URI

统一资源标识符,或叫做 URI,是用来标识互联网上的资源(例如,网页或文件)和怎样访问这些资源的传输协议(例如,HTTP 或 FTP)的字符串。

注意 除了encodeURI、encodeURIComponent、decodeURI、decodeURIComponent四个用来编码和解码 URI 的函数之外 ECMAScript 语言自身不提供任何使用 URL 的支持。