Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Jsp in Javascript || Javascript in Jsp  RSS feed

 
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
Boost this thread!