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 and javascript

 
vasudevan gopalan
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is it possible to write JSP inside javascript ? If so tell me with an example?
 
chanoch wiggers
Author
Ranch Hand
Posts: 245
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am not quite sure what you mean by this. Do you mean, can you create javascript dynamically using JSP scriptlets?
if so then yes. Here is an example I use. I have a function that preloads images but I want to determine the images to preload dynamically. I therefore add the list to the function call parameters using jsp. (real code not used, am paraphrasing here)
<SCRIPT>
imagePreloader(<%=imageListToLoad%> )
</SCRIPT>
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic