url编码有个bug,不能直接用decodeURIComponent,如果遇到前面的$会报错。

Posted 记录下自己走过前端的坑~

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了url编码有个bug,不能直接用decodeURIComponent,如果遇到前面的$会报错。相关的知识,希望对你有一定的参考价值。

decodeURIComponent("%") ----->Uncaught URIError: URI malformed

decodeURIComponent("%25") ----->%

  

decodeURLComponent(escape(’%’))

  

以上是关于url编码有个bug,不能直接用decodeURIComponent,如果遇到前面的$会报错。的主要内容,如果未能解决你的问题,请参考以下文章