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
encodedUriComponentThe 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));  

Press the button below to action the above code:


Related Tutorials

JavaScript Advanced Tutorials - Lesson 9 - Any Other Business

go to home page Homepage go to top of page Top