Why does decodeURIComponent('%') lock up my browser?

后端 未结 7 1146
别那么骄傲
别那么骄傲 2020-12-31 05:11

I was just testing something with AJAX and I found that on success if I alert

alert(decodeURI(\'%\'));

or

alert(encodeURIC         


        
7条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2020-12-31 05:31

    Chrome barfs when trying from the console. It gives an URIError: URI malformed. The % is an escape character, it can't be on its own.

提交回复
热议问题