辟谣啊,关于unescape escape is deprecated

2016-09-11 23:45:00
hainuo
原创 1397
摘要:辟谣啊,关于unescape escape is deprecated 这是假的,大家不要相信
在javascript中使用一个方法处理字符穿转换时发现有问题 ![](https://blog.hainuo.info/data/upload/201609/f_bf32b454e711bd50a521bf1f5e38b682.jpg)卧槽,竟然是被声明要丢弃了。怎么办。查资料 然后在w3cscool如此话语与这个即为符合> 提示和注释> 注释:ECMAScript v3 已从标准中删除了 unescape() 函数,并反对使用它,因此应该用 decodeURI() 和 decodeURIComponent() 取而代之。于是我开始扒书找到这个 http://www.ecma-international.org/ecma-262/5.1/#sec-B.2.1对这两个只说了几行```B.2.1 escape (string)The escape function is a property of the global object. It computes a new version of a String value in which certain characters have been replaced by a hexadecimal escape sequence.For those characters being replaced whose code unit value is 0xFF or less, a two-digit escape sequence of the form %xx is used. For those characters being replaced whose code unit value is greater than 0xFF, a four-digit escape sequence of the form %uxxxx is used....B.2.2 unescape (string)The unescape function is a property of the global object. It computes a new version of a String value in which each escape sequence of the sort that might be introduced by the escape function is replaced with the character that it represents.```并没有什么deprecated 之说。 所以放心大胆的用吧。不知道为什么w3cschool和jetbrain中为什么一直没有同步过来。
发表评论
肆 加 玖 =
评论通过审核后显示。