some errors I found, I am not sure this is the problem

<% System.out.println("the sum is :"+z); %>

This sentence must be within the body of html
 function addnos(var a,var b) {
 }

function addnos(a,b)

-----Original Message-----
From: Veena [mailto:[EMAIL PROTECTED]]
Sent: Sunday, January 17, 1999 8:40 AM
To: [EMAIL PROTECTED]
Subject: How to access a JAVASCRIPT method within JSP


Hi all

can i access a javascript method within jsp...............

what i mean to say is can i do something like this..
the code below is not working....So is there any alternative to do
this..........

code is as follows...........

<html>
<%! int x=10; %>
<%! int y=20; %>
<%! int z; %>
<% z=addnos(x,y) %>
<% System.out.println("the sum is :"+z); %>

<head>
<SCRIPT LANGUAGE="javascript">
 function addnos(var a,var b) {
 var c=a+b;
 return c;
}
</SCRIPT>
</head>
</html>

Thanks & Bye
KJV

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
FAQs on JSP can be found at:
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html

Reply via email to