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 Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Jsp in Javascript || Javascript in Jsp" Watch "Jsp in Javascript || Javascript in Jsp" New topic

Jsp in Javascript || Javascript in Jsp

Samer, qc

Joined: Jan 16, 2001
Posts: 2
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:

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.
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
jvascript String object-replace
Problem in passing a String with '&' to URL
how to delete the rows which are checked