• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Jsp & JavaScript & custom tags

 
kanth varada
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,

I have a taglib in jsp..

<r:itemDescription feedId="<%=string%>"/>

this taglib will display the discription on a jsp page...

when i am try to display that by using the javascript it is giving some problems

i.e document.write('<r:itemDescription feedId="<%=string%>"/>');

Iam try like this but it is showing some error...

because the discription is like this

discription--->//welcome to the world of buitie's and u are the most luckiest one among the person's

so what happens is it was considering from open single quation to one of the qatation in the discription.

I hope you understand what i meen to say....if you want more on this i will explain you...

but pls send me the solution for this....
a small sample example...
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65126
92
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Iam try like this but it is showing some error...


It is usually heplful to include the detailed error message.

However, in this case I can tell that you need to make sure that the string that is to be quoted in Javsscript has the quote characters escaped so that they do not confuse the Javscript parser. Much in the same way that you escape quotes in Java string literals.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic