JavaScript & jQuery Tutorials

JS Home Right Arrow JS Reference Right Arrow encodeURI()

encodeURI() global function

Global function URI encoding.


Encodes the special characters of a passed uri except the following:

 ; , / ? : @ & = + $ #


Signature Description
encodeURI(uri)Decodes any special characters of an encoded uri including components.


Parameter Description
uriThe uri to encode.

Below is an example of using the encodeURI() function.

// Encode a uri 
var uri="a spurious";

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