

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to decode a URL using JavaScript function?
To decode a URL in JavaScript, use the decodeURI() method.
Example
You can try to run the following code to decode a URL −
<!DOCTYPE html> <html> <body> <button onclick="display()">Check</button> <p id="demo"></p> <script> function display() { var uri = "welcome msg.jsp?name=åmit&sub=programming"; // first encode var encode = encodeURI(uri); var decode = decodeURI(encode); var result = "Encode= " + encode + "<br>" + "Decode= " + decode; document.getElementById("demo").innerHTML = result; } </script> </body> </html>
- Related Questions & Answers
- How to encode and decode a URL in JavaScript?
- How to encode a URL using JavaScript function?
- Function to decode a string in JavaScript
- How to create a URL object using JavaScript?
- PHP – How to decode a MIME header field using iconv_mime_decode() function?
- Writing a custom URL shortener function in JavaScript
- How to decode a string after encoding in JavaScript?
- Converting images to a Base64 data URL using Javascript
- How to define a JavaScript function using Function() Constructor?
- How to Use WebDriver Javascript Executor to Navigate to a URL using Postman?
- How to decode an encoded string in JavaScript?
- How to decode a job advertisement?
- JavaScript - Redirect a URL
- How to delay a JavaScript function call using JavaScript?
- How to get current URL in JavaScript?
Advertisements