ตัวอย่าง
ถอดรหัส URI หลังจากการเข้ารหัส:
var uri = "my test.asp?name=stale&car=saab";
var enc = encodeURI(uri);
var dec = decodeURI(enc);
var res = enc + "<br>" + dec;
ผลของความละเอียดจะเป็น:
my%20test.asp?name=st%C3%A5le&car=saab //
Encoded URI
my test.asp?name=stale&car=saab
// Decoded URI
ลองตัวเอง» ความหมายและการใช้งาน
decodeURI () ฟังก์ชั่นที่ใช้ในการถอดรหัส URI
เคล็ดลับ: ใช้ encodeURI () ฟังก์ชั่นการเข้ารหัส URI
สนับสนุนเบราว์เซอร์
ฟังก์ชัน | |||||
---|---|---|---|---|---|
decodeURI() | ใช่ | ใช่ | ใช่ | ใช่ | ใช่ |
วากยสัมพันธ์
decodeURI( uri )
ค่าพารามิเตอร์
Parameter | Description |
---|---|
uri | Required. The URI to be decoded |
รายละเอียดทางเทคนิค
กลับค่า: | สตริงตัวแทนถอดรหัส URI |
---|
