File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/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: 60053
    
  65

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]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Jsp & JavaScript & custom tags
 
Similar Threads
Jsp & JavaScript
custom Tags & javascriptlet in jsp
adding taglib to web.xml
How do I add custom tag libraries in a JSP page?
Passing the JSTL variable (with special characters) to JavaScript function?