Change URL back after decode with decodeURIComponent and encodeURIComponent - Javascript Global

Javascript examples for Global:decodeURIComponent

Description

Change URL back after decode with decodeURIComponent and encodeURIComponent

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <meta name="viewport" content="width=device-width, initial-scale=1"> 
      <script type="text/javascript">
var url = 'http%3AF%2Fmo-d6fa3.ao.tzp.corp%3A3000%2Flogin%2Ftest&client_id=x2.test";';

      </script> 
   </head> 
   <body> 
      <button onclick="console.log(decodeURIComponent(encodeURIComponent(url)))">Encode</button> 
      <button onclick="console.log(decodeURIComponent(url))">Decode</button>  
   </body>/*from www.  j  a va2  s. c  o  m*/
</html>

Related Tutorials