Hosting Solutions
mobile_logo Table of Contents
seal_frontseal_back

encodeURI

The encodeURI() function of the Global object converts undesirable symbols in a Uniform Resource Identifier with their proper UTF encoded versions. It works opposite the decodeURI() function.

All symbols except the symbols below will be converted: - _ . ! ~ * ' ( ) ; , / ? : @ & = + # $

SyntaxencodeURI( uri )

Parameters

uri The Uniform Resource Identifier string to be affected.

Examples

var encoded = encodeURI('http://www.website.com/na[me of{file>.html'); document.write( encoded ); /* http://www.website.com/na%5Bme%20of%7Bfile%3E.html */

JavaScript

Methods

addEventListeneralertaveragebackblurconcatcreatedecodeURIdecodeURIComponentencodeURIencodeURIComponentevaleveryfilterforwardgoisArrayisFiniteisNaNjoinparseFloatparseIntpoppushpushStatereducereplaceStatereverseshiftshuffleslicesomesortspliceunshiftwrite