且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在JavaScript中解码url编码的字符串

更新时间:2023-02-23 13:30:36

不是UTF-8,即百分比编码也称为url编码.

That is not UTF-8, that is percent encoding also known as url encoding.

您可以使用 decodeURIComponent()将其转换回显示之前的状态

You can use decodeURIComponent() to convert it back before displaying it

$("#quote1 span").html(decodeURIComponent(text1));