📘 Premium Read: Access my best content on Medium member-only articles — deep dives into Java, Spring Boot, Microservices, backend architecture, interview preparation, career advice, and industry-standard best practices.
✅ Some premium posts are free to read — no account needed. Follow me on Medium to stay updated and support my writing.
🎓 Top 10 Udemy Courses (Huge Discount): Explore My Udemy Courses — Learn through real-time, project-based development.
▶️ Subscribe to My YouTube Channel (172K+ subscribers): Java Guides on YouTube
1. Overview of encodeURIComponent() function
To encode full URI then check out JavaScript encodeURI() and decodeURI() Example article.- The encodeURIComponent() function encodes a URI component.
- This function encodes special characters. In addition, it encodes the following characters: , / ? : @ & = + $ #
- Note: Use the decodeURIComponent() function to decode an encoded URI component.
2. Overview of decodeURIComponent() function
- The decodeURIComponent() function decodes a URI component.
- Note: Use the encodeURIComponent() function to encode a URI component.
3. encodeURIComponent() and decodeURIComponent() function example
var uri = "https://javaguides.net/my test.html?name=ram&age29";
console.log("before encode :: " + uri);
var encode = encodeURIComponent(uri);
console.log("after encode :: " + encode);
var decode = decodeURIComponent(encode);
console.log("after decode :: " + decode);
before encode :: https://javaguides.net/my test.html?name=ram&age29
after encode :: https%3A%2F%2Fjavaguides.net%2Fmy%20test.html%3Fname%3Dram%26age29
after decode :: https://javaguides.net/my test.html?name=ram&age29
Next post, check out JavaScript encodeURI() and decodeURI() Example
Comments
Post a Comment
Leave Comment