Languages
[Edit]
EN

JavaScript - decode url characters

10 points
Created by:
Kate_C
24810

In this short article, we would like to show how in JavaScript, use decodeURIComponent() function to decode escaped unsafe characters in some URLs.

Hint: to know more about what characters are encoded/decoded read this article

Quick solution:

Where:

  • message value could be located in some URL:
  • message value can be extracted using:
    • String split() method (link here),
    • RegExp class (documentation link here),
    • built-in URL class (documentation link here),
    • some custom library (e.g query-string library).

 

More examples

Edit

In this section, you will find some example characters that must be encoded, and those that are not.

See also

Edit
  1. JavaScript - escape / encode url characters

Alternative titles

  1. JavaScript - decodeURIComponent() function example
  2. JavaScript - decode URI component function example
1
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.
Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join