Solved

URL encode through javascript

Posted on 2001-06-14
3
184 Views
Last Modified: 2006-11-17
I am building a string which has special characters like %. This string needs to be passed in URL.
The string "Type" has the special character.

URL = test.asp?abc=" + Type

Now when I use request.querystring it throws junk characters.
How can I get the exact string which I have passed.
     

0
Comment
Question by:Subo123
[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
3 Comments
 
LVL 22

Accepted Solution

by:
CJ_S earned 50 total points
ID: 6190443
escape and unescape.

escape will add the special characters while unescape will change them back:

var url = "mypage.asp?abc="+escape("a b c");
alert(url);

regards,
CJ
0
 

Author Comment

by:Subo123
ID: 6190495
Great! Itz working
0
 
LVL 22

Expert Comment

by:CJ_S
ID: 6190500
Why B if it works and it is the only possible answer??
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering 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, we'll look how to sort an Array in JavaScript, including the more advanced techniques of sorting a collection of records either ascending or descending on two or more fields. Basic Sorting of Arrays First, let's look at the …
I've been trying to accomplish this for a while and it just struck me yesterday how to accomplish this task. I have done searches all over the internet looking for ways to email pages from my applications and finally I have done it!!! Every single s…
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)
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…

717 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