I have a string such as "%2Fu%2F2069290%2F" in JavaScript (extracted from a web page). How do I get the human-readable version of that string?
I have a string such as %2Fu%2F2069290%2F in JavaScript (extracted from a web page).
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Short version: Use
decodeURIComponent().Longer version: In older versions of JavaScript you could use
unescape()but that has been deprecated since it only works properly for the LATIN1/ISO8859-1 codeset, so you really want to usedecodeURIComponent()which is supported by all modern browsers.