• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

c:param manipulations in jstl

 
Khushwinder Chahal
Ranch Hand
Posts: 128
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All

I have the following code for print button.





And the javascript function is like this
function mypopup(url)


But i am getting a problem here.
If my codename contains apostrophe(') i get a browser err that my url contains apostrophe(') in query string. And this err comes on the javascript functions's first line i.e. function mypopup(url) this one.

For removing this err i have to pass the codename such that it should not contain any apostrophe(').
Anybody has any idea how to replace it so that my query string does not get effected.

Thanks in advance.
Khushwinder
[ December 04, 2007: Message edited by: Bear Bibeault ]
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64717
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"khushwinder khushwinder", you have previously been warned on one or more occasions regarding adjusting your display name to meet JavaRanch standards. This is not optional. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it prior to your next post.

Your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.

Be aware that accounts with invalid display names are disabled.

bear
JavaRanch Sheriff
 
Khushwinder Chahal
Ranch Hand
Posts: 128
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Sheriff
Thanks for your information.
But tell me one thing... am i going to steel from your forum with my name???
I can not understand your policies.
You do not know the naming conventions in whole world , its clear.
Then why are you making rules.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you would like to complain about the naming policy or its enforcement, please use this forum. The JSP forum is for JSP discussions only.


Thank you for changing your screen name.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As to your original question.

Anytime you have text that's going to be used in Javascript code, it is a good idea to escape control characters before passing to the JSP.
These include single quotes, double quotes, and back slashes.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic