
What are decodeURI() and encodeURI() functions in JavaScript?

Many characters cannot be sent in a URL, but must be converted to their hex encoding. These functions are used to convert an entire URI (a superset of URL) to and from a format that can be sent via a URI.
<script type="text/javascript"> var uri="http://roseindia.net/users/loginregistration.html"; document.write(encodeURI(uri)+ "<br />"); document.write(decodeURI(uri)); </script>

Many characters cannot be sent in a URL, but must be converted to their hex encoding. These functions are used to convert an entire URI (a superset of URL) to and from a format that can be sent via a URI.
<script type="text/javascript"> var uri="http://roseindia.net/users/loginregistration.html"; document.write(encodeURI(uri)+ "<br />"); document.write(decodeURI(uri)); </script>
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.