wood burning stoves
The moose likes JSP and the fly likes Jsp & JavaScript & custom tags Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Jsp & JavaScript & custom tags" Watch "Jsp & JavaScript & custom tags" New topic

Jsp & JavaScript & custom tags

kanth varada

Joined: Feb 14, 2006
Posts: 14

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

Joined: Jan 10, 2002
Posts: 63873

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.

[Asking smart questions] [About Bear] [Books by Bear]
I agree. Here's the link: http://aspose.com/file-tools
subject: Jsp & JavaScript & custom tags
It's not a secret anymore!