Solved

URL variable values encoded

Posted on 2013-11-11
2
278 Views
Last Modified: 2013-11-13
The url variable value looks like myname%40domain.ca

How do I take that in Javascript and convert it to myname@domain.ca?
0
Comment
Question by:intoxicated_curveball
[X]
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
2 Comments
 
LVL 82

Accepted Solution

by:
leakim971 earned 500 total points
ID: 39639989
Test page : http://jsfiddle.net/45mHe/
var s = "myname%40domain.ca";
var d = unescape(s);

alert(d);

Open in new window

0
 
LVL 82

Expert Comment

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

var s = "myname%40domain.ca";
var d = decodeURI(s);

alert(d);

Open in new window


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

var s = "myname%40domain.ca";
var d = decodeURIComponent(s);

alert(d);

Open in new window


Check this article : http://xkr.us/articles/javascript/encode-compare/
Or google for : difference between escape and encodeuricomponent
https://www.google.com/search?q=difference+between+escape+and+encodeuricomponent
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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.
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
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…

751 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