decodeURI() global function JS Home  <<  JS Reference  <<  decodeURI()

Global function URI decoding.

Description

Decodes any special characters of an encoded uri.

Syntax

Signature Description
decodeURI(encodedUri)Decodes any special characters of an encoded uri.

Parameters

Parameter Description
encodedUriThe uri to decode.

Below is an example of using the decodeURI() global function.


// Encode and then decode a uri 
var uri="a spurious name.com?firstname=barney&surname=magrew";
  
alert(encodeURI(uri));
alert(decodeURI(uri));  

Press the button below to action the above code:

Related Tutorials

JavaScript Advanced Tutorials - Lesson 9 - Any Other Business