Solved

URL encode through javascript

Posted on 2001-06-14
3
182 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
  • 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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Adding Row and Cell on a table 14 25
how can i make 2 columns? 4 42
Add or delete table rows 10 55
jQuery Dialog Autoresize Bug 2 25
This article will give core knowledge of JavaScript and will head in to your first JavaScript program. I am Durvesh Naik and I am here to deal with this series of JavaScript. I will teach you JavaScript in part wise , as its quite boring to read big…
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 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…

820 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