This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
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 Android Security Essentials Live Lessons this week in the Android forum!
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: 60791
    
  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]
 
 
subject: Jsp & JavaScript & custom tags
 
Similar Threads
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?
custom Tags & javascriptlet in jsp
Jsp & JavaScript