Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Java in JavaScript

Reply
Thread Tools

Java in JavaScript

 
 
gargoyle47
Guest
Posts: n/a
 
      10-25-2008
I want to use an HTML form incorporating JavaScript and also a Java
applet.
My idea is to have text entered in a webform, captured by the JS and
then a Java applet called with the form text as the input argument.
The applet will then manipulate the text and return a string back to
JS for additional processing before being submitted as web form mail.

I know how to invoke the applet from JS with input text:
document.myApplet.newText(tempText) // invokes method in Java class
and in the Java class:
public void newText(String s) {
this.whatToSay = s;
etc.
}

but what I don't know how to do is return a string from Java back to
the JS, i.e. how to capture the returned string using JS.

Can somebody please help?
Thanks
 
Reply With Quote
 
 
 
 
Arved Sandstrom
Guest
Posts: n/a
 
      10-25-2008
"gargoyle47" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>I want to use an HTML form incorporating JavaScript and also a Java
> applet.
> My idea is to have text entered in a webform, captured by the JS and
> then a Java applet called with the form text as the input argument.
> The applet will then manipulate the text and return a string back to
> JS for additional processing before being submitted as web form mail.
>
> I know how to invoke the applet from JS with input text:
> document.myApplet.newText(tempText) // invokes method in Java class
> and in the Java class:
> public void newText(String s) {
> this.whatToSay = s;
> etc.
> }
>
> but what I don't know how to do is return a string from Java back to
> the JS, i.e. how to capture the returned string using JS.
>
> Can somebody please help?
> Thanks


What happened with

var result = document.myApplet.newText(tempText);

Don't forget to change the return type of newText to String.

AHS


 
Reply With Quote
 
 
 
 
gargoyle47
Guest
Posts: n/a
 
      10-27-2008
On Oct 25, 12:24*pm, "Arved Sandstrom" <(E-Mail Removed)>
wrote:
> "gargoyle47" <(E-Mail Removed)> wrote in message
>
> news:(E-Mail Removed)...
>
>
>
> >I want to use an HTML form incorporating JavaScript and also a Java
> > applet.
> > My idea is to have text entered in a webform, captured by the JS and
> > then a Java applet called with the form text as the input argument.
> > The applet will then manipulate the text and return a string back to
> > JS for additional processing before being submitted as web form mail.

>
> > I know how to invoke the applet from JS with input text:
> > document.myApplet.newText(tempText) *// invokes method in Java class
> > and in the Java class:
> > public void newText(String s) {
> > this.whatToSay = s;
> > etc.
> > }

>
> > but what I don't know how to do is return a string from Java back to
> > the JS, i.e. how to capture the returned string using JS.

>
> > Can somebody please help?
> > Thanks

>
> What happened with
>
> var result = document.myApplet.newText(tempText);
>
> Don't forget to change the return type of newText to String.
>
> AHS


Now I remember, thanks.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Hot Requirements: 1.Sr Java Developer,2.Java Developer (Java with EJB) Isaac Java 0 01-20-2011 08:41 PM
hey i am just started java,, can anyone tell me the use ,application, why java , importance of java.. manish sahu Java 3 02-14-2008 12:00 AM
Javascript -> Applet: variable reset after method call from javascript?! mcdeveloper Java 1 06-13-2006 08:34 AM
[JAVA] [EVALUATION] - The Java Failure (Sorry: The Java(tm) Failure) Ilias Lazaridis Java 0 02-01-2005 10:32 AM
Job to convert Java App 1.3.1 to Java Newest of Java Michael Kintner Java 0 11-30-2003 04:42 AM



Advertisments