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
  • 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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Introduction A frequently asked question goes something like this:  "I am running a long process in the background and I want to alert my client when the process finishes.  How can I send a message to the browser?"  Unfortunately, the short answer …
In this article you'll learn how to use Ajax calls within your CodeIgniter application. To explain this, I'll illustrate how to implement a simple contact form to allow visitors to send you an email through your web site.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. 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.: (CODE)

813 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now