Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa JavaScriptQuestions decodeURI() and encodeURI() functions in JavaScript

Have Programming Question? Ask it here!
 
 
 


samar
decodeURI() and encodeURI() functions in JavaScript
2 Answer(s)      3 years and 9 months ago
Posted in : JavaScript Questions


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


Advertisement
View Answers

November 10, 2010 at 4:43 PM


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>


November 10, 2010 at 4:43 PM


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>


Related Tutorials/Questions & Answers:
 

 

 

DMCA.com