Posted On: Feb 22, 2018
encodeURI() function is used to encode an URL in Javascript.It takes a url string as parameter and return encoded string. Note: encodeURI() did not encode characters like / ? : @ & = + $ #, if you have to encode these characters too please use encodeURIComponent(). Usage:
var uri = "my profile.php?name=sammer&occupation=pāntiNG"; var encoded_uri = encodeURI(uri);
decodeURI() function is used to decode an URL in Javascript.It takes a encoded url string as parameter and return decoded string. Usage:
var uri = "my profile.php?name=sammer&occupation=pāntiNG"; var encoded_uri = encodeURI(uri); decodeURI(encoded_uri);
Never Miss an Articles from us.
Javascript Javascript is an object-oriented computer programming language commonly used to create interactive effects wi..
What is the difference between let and var?..