decodeURIComponent()
global functionS2C Home « Globals « decodeURIComponent()
Global function URI decoding.
Description
Decodes any special characters of an encoded uri including components.
Syntax
Signature | Description |
---|---|
decodeURIComponent(encodedUriComponent) | Decodes any special characters of an encoded uri including components. |
Parameters
Parameter | Description |
---|---|
encodedUriComponent | The uri component to decode. |
Below is an example of using the decodeURIComponent()
function.
// Encode and then decode a uri
var uri="a spurious name.com?firstname=barney&surname=magrew";
alert(encodeURIComponent(uri));
alert(decodeURIComponent(uri));
Related Tutorials
JavaScript Advanced Tutorials - Lesson 9 - Any Other Business