Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within HTML Pages with CSS and JavaScript
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Jeanne Boyarsky
Ron McLeod
Paul Clapham
Liutauras Vilda
Sheriffs:
paul wheaton
Rob Spoor
Devaka Cooray
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Carey Brown
Frits Walraven
Tim Moores
Bartenders:
Mikalai Zaikin
Forum:
HTML Pages with CSS and JavaScript
How to pass '&' as a query string through url
Abhijeet Rathod
Greenhorn
Posts: 2
posted 17 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
It is very difficult to get the value of parameter as containing '&'.
As & is a character which separates two parameter value pair.
Do any body find any solution for it?
Its really bad situation
Thanks & Regards,<br />Abhijeet
Jaikiran Pai
Sheriff
Posts: 10445
227
I like...
posted 17 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Use the escape function to encode the character:
Escape special characters
Here's a small sample:
<html> <head> <script type="text/javascript"> function myfunction(txt) { var tb =document.getElementById("t1") alert(tb.value) alert(escape(tb.value)) } </script> </head> <body> <form> <input type="button" onclick="myfunction('Hello')" value="Call function"> <input type="text" id="t1"/> </form> </body> </html>
[
My Blog
] [
JavaRanch Journal
]
Christophe Verré
Sheriff
Posts: 14691
16
I like...
posted 17 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
You need to encode the url. You can try a little encoder here :
http://www.blooberry.com/indexdot/html/topics/urlencoding.htm
If you want to do it in
JSP
, you can use JSTL c:url.
From a
servlet
, you can use encodeUrl() of the Servlet API.
[My Blog]
All roads lead to JavaRanch
Abhijeet Rathod
Greenhorn
Posts: 2
posted 17 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Thanks For the reply,
It works useing encoder()
Thanks & Regards,<br />Abhijeet
Heroic work plunger man. Please allow me to introduce you to this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Using servlets params from filters
Passing parameter to view in DB2
checkboxes
how request.getParameter works?
Classcast exception
More...