AIR 51.2已于2025/03/03发布!
decodeURI
阅读
2022-09-17更新
最新编辑:--小小晓痴--
阅读:
更新日期:2022-09-17
最新编辑:--小小晓痴--
decodeURI()函数
public function decodeURI(uri:String):String
语言版本:ActionScript 3.0
将已编码的 URI 解码为字符串。返回一个字符串,其中以前由 encodeURI 函数编码的所有字符都还原为它们的未编码表示形式。
下表显示不会 由 decodeURI 函数解码为字符的转义序列的集合。使用 decodeURIComponent() 可解码此表中的转义序列。
| 未解码的转义序列 | 字符等效形式 |
|---|---|
| %23 | # |
| %24 | $ |
| %26 | & |
| %2B | + |
| %2C | , |
| %2F | / |
| %3A | : |
| %3B | ; |
| %3D | = |
| %3F | ? |
| %40 | @ |
参数
uri:String — 一个使用 encodeURI 函数编码的字符串。
返回
String — 一个字符串,其中以前由 encodeURI 函数转义的所有字符都还原为它们的未转义表示形式。
示例
package {
import flash.display.Sprite;
public class DecodeURIExample extends Sprite {
public function DecodeURIExample() {
var uri:String = "http://www.example.com/application.jsp?user=<user name='some user'></user>";
var encoded:String = encodeURI(uri);
var decoded:String = decodeURI(encoded);
trace(uri); // http://www.example.com/application.jsp?user=<user name='some user'></user>
trace(encoded); // http://www.example.com/application.jsp?user=%3Cuser%20name='some%20user'%3E%3C/user%3E
trace(decoded); // http://www.example.com/application.jsp?user=<user name='some user'></user>
}
}
}
本页面部分内容来自Adobe ActionScript 3.0 API参考[1]。

沪公网安备 31011002002714 号