Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Jsp in Javascript || Javascript in Jsp

 
Samer, qc
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 %>';
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic