Click here to Skip to main content
15,896,063 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
sir,
how to pass special characters(like #@'`~%&*)in javascript function and URL.
Posted

1 solution

You need to encode them.

For Javascript, you can use encodeURIComponent or escape function. Here, have a look at it:
JavaScript: Escaping Special Characters[^]
JavaScript » Functions » encodeURIComponent[^]


Also see:
MSDN: Special Characters[^]
Introduction to URL Encoding[^]

For HTML string encoding: MSDN: Server.HTMLEncode Method[^]
 
Share this answer
 
Comments
Gnanavel Rng 19-Jun-12 6:10am    
Thanks,
when used escape, single quotes convert to %27.when we pass this parameter to javascript function , it gave error.
How to pass parameter with single quotes or double quotes in java script function .
Sandeep Mewara 22-Jun-12 1:08am    
What error?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900