This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes How to call javascript functions from JSP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "How to call javascript functions from JSP" Watch "How to call javascript functions from JSP" New topic
Author

How to call javascript functions from JSP

Fritz Largosa
Ranch Hand

Joined: Sep 12, 2005
Posts: 70
<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

Joined: Nov 08, 2001
Posts: 15376
    
    6
Just write out the function to the page that you need.

Eric
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60785
    
  65

You can't.

Please read this JavaRanch Journal article to find out why.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to call javascript functions from JSP
 
Similar Threads
servlets and Jsp's
jsp and navigation or jsp calling javascript function
Acessing Function Properties
how to start an action from a link...
Head First Servlets & JSP book - JSP Question