Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to call javascript functions from JSP

 
Fritz Largosa
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<script language='javascript'>
function A(){...}
function B(){...}
</script>


<%
if (A > B)
A();//how do I call this javascript function within JSP
else
B();//how do I call this javascript function within JSP

%>

Thanks.
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just write out the function to the page that you need.

Eric
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64833
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can't.

Please read this JavaRanch Journal article to find out why.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic