*
The moose likes Servlets and the fly likes Jsp in Javascript || Javascript in Jsp Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Jsp in Javascript || Javascript in Jsp" Watch "Jsp in Javascript || Javascript in Jsp" New topic
Author

Jsp in Javascript || Javascript in Jsp

Samer, qc
Greenhorn

Joined: Jan 16, 2001
Posts: 2
Hello,
I'm VERY new in JSP. I have a javascript function that dynamically creates new rows in a table already defined in the html. I want to put a variable defined in jsp into the javascript function, how do i do that? Here is the javascript function:

thanx,
Samer
Danny Mui
Ranch Hand

Joined: Dec 14, 2000
Posts: 42
If you want to display the value of any jsp variable (assuming a proper toString() conversion) just type <%= variable %> inline to the javaScript code.
ie.
var javascriptVar = '<%= jspVariable %>';
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Jsp in Javascript || Javascript in Jsp
 
Similar Threads
Alternative to ActiveXObject
java.lang.NullPointerException
jvascript String object-replace
Problem in passing a String with '&' to URL
how to delete the rows which are checked