URL variable values encoded

Posted on 2013-11-11
Last Modified: 2013-11-13
The url variable value looks like

How do I take that in Javascript and convert it to
Question by:intoxicated_curveball
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
LVL 82

Accepted Solution

leakim971 earned 500 total points
ID: 39639989
Test page :
var s = "";
var d = unescape(s);


Open in new window

LVL 82

Expert Comment

ID: 39639999
You may need decodeURI instead (will replace encoded :/;? too) :

var s = "";
var d = decodeURI(s);


Open in new window

or decodeURIComponent instead (will replace encoded ~!@#$%^&*(){}[]=:/,;?+'"\ too) :

var s = "";
var d = decodeURIComponent(s);


Open in new window

Check this article :
Or google for : difference between escape and encodeuricomponent

Featured Post

WordPress Tutorial 1: Installation & Setup

WordPress is a very popular option for running your web site and can be used to get your content online quickly for the world to see. This guide will walk you through installing the WordPress server software and the initial setup process.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

623 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question