Re: Calling java within javascript
- From: "web.dev" <web.dev.cs@xxxxxxxxx>
- Date: 30 Aug 2006 15:34:37 -0700
misdst23 wrote:
Hi,
I know I can call a static java method within javascript by using the
<% ... %> tags. But how can pass a javascript variable ?
Since you are mentioning java, I'm assuming you are creating JSP's.
function thefunction()
{
var = javascriptvariable ;
'var' is a keyword in javascript. Proper usage will be like the
following:
var variable_name = value;
<% testClass.set(var) ; %> ;
}
To do what you want, you can do something like the following:
function myFunc()
{
<%
System.out.println("var variable_name = " + value);
%>
}
Your value will have to be surrounded by quotes depending on whether
it's a string value or not.
.
- Follow-Ups:
- Re: Calling java within javascript
- From: misdst23
- Re: Calling java within javascript
- References:
- Calling java within javascript
- From: misdst23
- Calling java within javascript
- Prev by Date: Calling java within javascript
- Next by Date: FAQ Topic - How do I get a perl/asp/php variable into client-side js?
- Previous by thread: Calling java within javascript
- Next by thread: Re: Calling java within javascript
- Index(es):
Relevant Pages
|