• Post Reply Bookmark Topic Watch Topic
  • New Topic

calling javascript function from jstl

 
joseph prabhu
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i am using jstl and javascript. i want to call javascript function from jstl. but javascript function is not getting calling the code is following one.

 
Bauke Scholtz
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Java/JSP/JSTL runs at the server machine and produces HTML/CSS/JS output.
Server sends HTML/CSS/JS output to client machine.
Client receives HTML/CSS/JS and only then it starts to run.

Whenever you want to invoke Javascript with Java, you need to write it out as a Javascript function or variable.
Whenever you want to invoke Java with Javascript, you need to invoke a request to the server machine.

If you really, really want to perform client-dependent tasks, then you need to do it fully in Javascript. You can't do a browser-check reliably in Java.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65524
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please read this article to understand how JSP works.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!