URL encode through javascript

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.
     

Subo123Asked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
CJ_SConnect With a Mentor Commented:
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
 
Subo123Author Commented:
Great! Itz working
0
 
CJ_SCommented:
Why B if it works and it is the only possible answer??
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.