aspose file tools*
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
JavaRanch » Java Forums » Java » JSP
Bookmark "Jsp & JavaScript & custom tags" Watch "Jsp & JavaScript & custom tags" New topic
Author

Jsp & JavaScript & custom tags

kanth varada
Greenhorn

Joined: Feb 14, 2006
Posts: 14
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

Joined: Jan 10, 2002
Posts: 61237
    
  66

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] [Bear's FrontMan] [About Bear] [Books by Bear]
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Jsp & JavaScript & custom tags