JavaScript unescape() 函数

定义和用法

unescape() 函数在 JavaScript 1.5 版中已弃用。请使用 decodeURI()decodeURIComponent() 代替。

unescape() 函数对编码的字符串进行解码。

实例

编码和解码字符串:

var str = "Need tips? Visit CodeW3C.com!";
var str_esc = escape(str);
document.write(str_esc + "<br>")
document.write(unescape(str_esc))

亲自试一试

语法

unescape(string)

参数值

参数 描述
string 必需。

Browser support

Function Chrome Edge Firefox Safari Opera
unescape() Support Support Support Support Support

Technical details

Return value: String, representing the decoded string.