What is decodeURI(), encodeURI() in JavaScript?

Answer

To send the characters that can not be specified in a URL should be converted into their equivalent hex encoding. To perform this task the methods encodeURI() and decodeURI() are used.

For example, the following code snippet performs the encoding of URL:

<script type="text/javascript">
          var uri = http://www.mysite.com/city?=Banglore; // original URI
          var ncodeuri=encodeURI(uri);
          document.write("<br />ncodeuri”);
          var dcodeuri = decodeURI(ncodeuri);
          document.write(“<br>/>dcodeuri”);
</script>

All sql dba Questions

Ask your interview questions on sql-dba

Write Your comment or Questions if you want the answers on sql-dba from sql-dba Experts
Name* :
Email Id* :
Mob no* :
Question
Or
Comment* :
 





Disclimer: PCDS.CO.IN not responsible for any content, information, data or any feature of website. If you are using this website then its your own responsibility to understand the content of the website

--------- Tutorials ---