Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

escape pound sign

Status
Not open for further replies.

marouanemeft

Programmer
Sep 29, 2004
10
US
Hi
I have a jsp page that is being passed a few paramaters, but it doesn't function properly if a parameter name or parameter value has a pound sign in it, for example if a parameter value is "#someValue" then things won't function.
is there any method in javascript that will escape the pound sign?

Thanks in advance
 
try something like this:
Code:
str = 'somepage.jsp?var1=!@#$%^&';
str = escape(str);
window.location = str;

and on your receiving page, use unescape(str) to turn the characters back into their literal values


-kaht

banghead.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top